From: Juliusz Chroboczek
Subject: How do people write a REPL?
Date: 
Message-ID: <87itcitkkb.fsf@pps.jussieu.fr>
Hello,

I'm wondering what is the standard idiom for a REPL.  I've always
written

  (catch 'foo-quit
    (loop
      (with-simple-restart (toplevel "Return to the FOO toplevel")
         ...)))

but after all the ``efficiency'' discussions I find myself wondering
whether it is a good idea to establish and tear down the restart on
every iteration.

Do perhaps people have two different main loops for interactive and
batch execution?

                                        Juliusz

P.S. Don't worry.  I'm not writing Yet Another Implementation of Common Lisp.
From: Paolo Amoroso
Subject: Re: How do people write a REPL?
Date: 
Message-ID: <DTnxO1iBIPPPt1sPMCt5cH1EFIGM@4ax.com>
On 10 Nov 2001 21:52:52 +0100, Juliusz Chroboczek <ยทยทยท@pps.jussieu.fr>
wrote:

> I'm wondering what is the standard idiom for a REPL.  I've always

You may check section 6.1 "An Interactive Interpreter Tool" of Peter
Norvig's book "Paradigms of Artificial Intelligence Programming".


Paolo
-- 
EncyCMUCLopedia * Extensive collection of CMU Common Lisp documentation
http://web.mclink.it/amoroso/ency/README
[http://cvs2.cons.org:8000/cmucl/doc/EncyCMUCLopedia/]