Arc Forumnew | comments | leaders | submitlogin
1 point by CatDancer 5977 days ago | link | parent

If you have ten users currently logged in and you're at the repl, which user do you want to get?


1 point by thaddeus 5977 days ago | link

The one signed in whom clicks submit at the repl... I'm thinking more like 2 admins at the repl.... this is a trick question right?

-----

2 points by CatDancer 5976 days ago | link

Not a trick question, I wasn't quite getting what you wanted to do.

Ok, so you could have the defop repl store the current user in a global variable which you could then access from the prompt. Which would work fine as long as you only had one person logging in as an admin at a time.

If you have more than one person logging in as an admin at a time and you want to know who you are from the prompt, it sounds like the challenge is to get the dynamic value of the user name into the scope of the eval'ed expression?

-----

2 points by thaddeus 5976 days ago | link

Yeah I tried going straight to your second idea (ouch!).

I really don't have 2 admins, but was trying to future proof it. I think I will just start with setting the global variable.

Thanks. T.

-----

2 points by CatDancer 5976 days ago | link

Right, well, notice that the repl-history*, that, and thatexpr are also global variables, and so future proofing it for multiple admins will take more work than just the eval issue.

(For getting values into the eval, one way to do it is with an MzScheme feature called parameters; I have a library to let you use those from Arc which I haven't quite finished yet).

-----