January 19 meeting notes

Kevin Reid kpreid at switchb.org
Thu Jan 19 17:23:57 PST 2012

On Jan 19, 2012, at 19:40, Waldemar Horwat wrote:

> Waldemar:  What about read-eval-print loops?
> MarkM:  Each eval inserts one more nested scope.
> Waldemar:  What if someone does this:
> > let x = 3;
> > function foo() {return x;}
> > let x = 7;
> This would leave foo returning 3.
> MarkM:  That's the proper behavior.  Anything else has problems.
> Waldemar:  [incredulous]
> Allen:  We shouldn't spec read-eval-print loops.

In case it is relevant to the ‘problems’, I would like to remind MarkM that E used to behave in the return-7 way at REPL, and we abandoned it not because it wasn't nice REPL behavior but only because it meant that anything defined at top-level was forced to not be deep-frozen due to it closing over those slightly magic variables, but that is not an issue here since JavaScript doesn't have deep-frozen-in-that-sense functions.

(I'm not advocating returning 7; I’m just checking that 3 is returned for valid reasons.)

Kevin Reid                                  <http://switchb.org/kpreid/>

More information about the es-discuss mailing list