These are shortcuts that old Lisp hackers know by heart (http://bit.ly/2Ll3qS ), although they have been renamed to be legal Javascript symbols. This is why we have not felt any need to document them. :)

They are supposed to work in all runtimes. In an attempt to reduce global namespace pollution, I moved them out of the global namespace into `Debug.environment` (which is where they more properly belong -- the Debugger should not be storing its state in the application's namespace), as is stated in your first reference. See the note at line 91 of swf9/LzDebug.as. What really needs to happen is for the swf9 debug evaluator to wrap `with (Debug.environment) { ... }` around the expressions it compiles, just as dhtml/LzDebug.js does in `doEval`. I think this has to happen in the compiler, not the debugger, because of the other code the compiler wraps around evaluations to heuristicate whether it is an expression or statement and to report errors.

On 2009-09-27, at 07:06, André Bargull wrote:

The last three results of debugger evals are stored in '_', '__' and '___' to provide a fast way to access these values again. Currently, swf8 stores the values in the global object, whereas AS3 runtimes store the values in the global object "global". This means in swf8 you could write 'Debug.write("last result was %#w", _)', but this is currently not possible in swf9/swf10. My question: Should this be considered as a bug? I don't think there is any official documentation for these short-hands [1], so maybe it was only intended that '_' as a single expression should work?!

PS: '_' as a single expression works in swf9/swf10, because that's a "simple expression" and therefore handled by "evalSimpleExpr" which calls "globalValue" and "globalValue" looks up values in the global object "global".

[1] Google only found these two results:
- http://www.openlaszlo.org/pipermail/laszlo-dev/2009-June/021356.html
- http://jira.openlaszlo.org/jira/browse/LPP-630


Reply via email to