On Dec 11, 2009, at 5:08 AM, Laurent PETIT wrote:

> But then, we could even go one level deeper: not only provide a particular 
> instance that would allow to quit the REPL, but a set of instances. And if 
> the returned value of the call to the REPL returns one of the instances in 
> the set, then quit.
> This would allow to nest debug-repls (but is it interesting ?) calls, and to 
> go back to the encapsulating repl by e.g. a call to debug-repl/quit(1), or to 
> go up 2 levels in the debug-repls nesting by calling debug-repl/quit(2), ... 
> or to go back to the main environment by e.g. a call to debug-repl/quit().

One possible implementation of this is to use keywords as commands to the 
debug-repl. Since evaluating a keyword (alone on a line by itself) is seldom 
interesting, we could use ones like :quit or :pop as commands intercepted by 
the debug repl before evaluation. We could even respond to a set of commands 
and send any unrecognized commands along to the evaluator.

If hijacking namespace-less keywords for that purpose is distasteful, we could 
also put the commands in a namespace, for example:

        :dr/quit

--Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to