Newsgroups: comp.lang.misc,comp.lang.scheme,comp.lang.tcl,comp.os.linux.misc
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!europa.eng.gtefsd.com!howland.reston.ans.net!EU.net!uunet!sytex!smcl
From: smcl@sytex.com (Scott McLoughlin)
Subject: Re: GNU Extension Language Plans
Message-ID: <yBDVuc1w165w@sytex.com>
Sender: bbs@sytex.com
Organization: Sytex Access Ltd.
References: <38opfa$3m2@mathserv.mps.ohio-state.edu>
Date: Thu, 27 Oct 1994 19:29:33 GMT
Lines: 54
Xref: glinda.oz.cs.cmu.edu comp.lang.misc:18485 comp.lang.scheme:10731 comp.lang.tcl:20996 comp.os.linux.misc:31127

davis@pacific.mps.ohio-state.edu writes:

> In article <38loi6$3u1@info.epfl.ch>, Stefan Monnier <monnier@di.epfl.ch> wro
>  : Do you really think it's frequent in elisp to generate code on the
>  : fly, for example ?
> 
> I do it quite often in JED.  For example, almost everyday I will type Ctrl-X
> ESC and enter some code at the `S-Lang>' prompt.   Usually though, I am
> testing an debugging packages for JED.  For example, suppose that I decide
> to write a function that numbers lines in a buffer.  I move to the scratch
> buffer and type:

[ Example of top level definition deleted. ]

Howdy,
        I do not see a big problem compiling/running top level
definitions and bits of code. One can easily compile to bytecode
so fast that the user will have _no idea_  with regard to
eval VS. compile/run. Many "existence proofs" abound.
        I think the original poster was concerned with
examples like this:

(defun weird-lisp (op-key arg1 arg2)
   (eval (list (find-op op-key) arg1 arg2))))

Here we are building Lisp expressions INSIDE OF LISP and 
running them.  Here an interpreter will probabily be
faster than a compile/run sequence, especially for 
small, non-iterating expressions.

        Many folks (including me) consider this bad Lisp
in general. In most of the cases, LAMBDA will do a better
job. Nevertheless, the practice exists. A few months ago,
a poster on BIX was using EVAL +  ASSOC in lieue of a
CASE construct! When I pointed him in the right direction,
he replied that he though CASE was "fancy". Go figure.
        In general, I think the read/compile/run/print loop
is better than read/eval/print, although debugging/stepping/
etc. might suffer or be lots more work.  In these cases,
an EVAL can look for the trivially simple cases (literals,
variables) and compile/run the rest.  
        Anyway, I think SCM does clever modifications of
S-Expression representations of programs to achieve some
of the speed-ups one gets from a byte code compiler, so
it looks like a good middle ground given its other
advantages.  In general, though, no Lisp I know does
anything so brain damaged as performing the "read"
portion of the interpretation cycle more than once,
like many other language interpreters do.

=============================================
Scott McLoughlin
Conscious Computing
=============================================
