<makomo>
when you put multiple forms onto a single line in the SLIME REPL, is it correct that it evaluates them by effectively combining the forms using PROGN and evaluating that?
<makomo>
i.e. it's not the same as if you had entered all of the forms separately, one after another
<makomo>
this is best seen when making use of the * variable (also ** and ***)
<makomo>
e.g. evaluating "100" and then "(print (+ * 50)) (print *) (print (+ * 30))" results in "150 100 130"
<stassats>
makomo: no, each form is evaluated separately
<makomo>
if that was true, wouldn't * be rebound to the value of the previous form?
<stassats>
whatever you are showing doesn't mean anything
<stassats>
each separate form is evaluated separately, each calling EVAL
<makomo>
well i get that, but you can see that * isn't rebound in the same way as if the forms were evaluated each on a separate line
<stassats>
and then what?
<makomo>
that was the whole point of my question. the effect is the same as if SLIME combined the forms into a PROGN and evaluated that
<stassats>
no, that's not what happens
<stassats>
it's not combined into a progn
<stassats>
and the effect is completely different
<makomo>
well, maybe it isn't exactly like that (that's why i said "as if" and "effectively")
<makomo>
hm, what's completely different about it?
<stassats>
each form is treated separately
<stassats>
anything that can observe that will behave differently
<stassats>
it's as if you write three forms into a file or wrap them into PROGN
<makomo>
give that a top-level PROGN has that special behavior where the file compiler will treat all of its subforms as top-level, i can't think of any code that could observe any difference
<makomo>
got any example?
<makomo>
given*
<makomo>
hm, maybe user code wouldn't be able to see it, but you would certainly call EVAL 3 times instead of 1, i guess?
<makomo>
so then it is the behavior of the * variable that is """weird""" then
<makomo>
multiple forms on a single line are treated separately, but * is rebound only once all of the forms have been evaluated (and the value of the last form is used)
<makomo>
it isn't rebound after every form, even though they are treated separately
stassats has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
<makomo>
looking at SLIME/SWANK's implementation, EVAL-REGION is used to evaluate every line and it indeed treats multiple forms separately
<makomo>
but *, **, ***, +, ++, +++, /, //, /// are all bound outside of EVAL-REGION, within REPL-EVAL, and only with the result of the last form in the region
<makomo>
shouldn't they be bound after *every* form
scymtym has quit [Ping timeout: 240 seconds]
Achylles has quit [Ping timeout: 258 seconds]
Achylles has joined #slime
makomo has quit [Quit: WeeChat 2.2]
Achylles has quit [Remote host closed the connection]