luis changed the topic of #slime to: SLIME, the Superior Lisp Interaction Mode for Emacs | https://common-lisp.net/project/slime | https://irclog.tymoon.eu/freenode/%23slime | https://irclog.whitequark.org/slime
stassats` has joined #slime
stassats has quit [Ping timeout: 245 seconds]
stassats` has quit [Ping timeout: 245 seconds]
_whitelogger has joined #slime
_whitelogger has joined #slime
_whitelogger has joined #slime
_whitelogger has joined #slime
moldybits has quit [Ping timeout: 245 seconds]
moldybits has joined #slime
stassats has joined #slime
scymtym has quit [Ping timeout: 252 seconds]
_whitelogger has joined #slime
scymtym has joined #slime
_whitelogger has joined #slime
micro has quit [Ping timeout: 240 seconds]
micro has joined #slime
Achylles has joined #slime
<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> there's no if, it's true
<makomo> (print *) should then print 150, not 100
<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?
<stassats> try (progn (require :alexandria) (alexandria:gaussian-random))
<stassats> and without progn
<makomo> ah yeah, true, i forgot about that
<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
<makomo> oh wait what
<makomo> *, + and / are not a feature of SLIME
<makomo> i thought that was a SLIME thing...
moldybits has quit [Quit: WeeChat 2.4]
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]