Re: Iteration in lisp



Matthias Benkard <mulkiatsch@xxxxxxxxx> writes:

On 3 Mai, 07:14, lisp1.3.CalRob...@xxxxxxxxxxxxxxx (Robert Maas,
http://tinyurl.com/uh3t) wrote:
From: Kent M Pitman <pit...@xxxxxxxxxxx>
I was talking more about the notion that
 (progv '(x) '(3)
   (eval '(+ x 1)))
is not portably well-defined without doing
 (progv '(x) '(3)
   (eval '(locally (declare (special x)) (+ x 1))))

Oh, maybe I saw that many months ago and ignored it because I never
use PROGV in my code anyway. I just treat PROGV as a useless crock,
like COERCE.

PROGV is not the issue here. Free variable references are the issue.
Isn't the behaviour of

(let ((x 3))
(declare (special x))
(eval '(+ x 1)))

just as ill-defined?

Thanks for making this point. Yes. PROGV is a red herring here.

The main reason that PROGV was used in my example is that if you were
building a simple scripting language or a rule-based language and
wanted to establish a few bindings and then allow a situation where
script-supplied expressions were evaluated in the context of those names,
you couldn't just do a simple eval on what the user provides you, and
that's a shame because while it's not done a whole lot, it's very appealing
to people trying to understand why Lisp is different than other languages
because other languages don't easily let you do that... and the way it's
defined right now, Lisp is also putting roadblocks in your way, so it
makes the point blurrier.

I rarely PROGV directly, and its syntax is kind of lousy, but it is
one of those subprimitive thigns that is sometimes useful for
implementing other facilities.
.



Relevant Pages

  • Re: Some advice for a lisp newb
    ... > pick up Lisp little by little, ... language seemed weird to me. ... scripting language. ... So now I am going through the trials of learning Lisp. ...
    (comp.lang.lisp)
  • Re: Is ECMAScript really a dialect of Lisp?
    ... various degrees in every programming language. ... popular scripting language to be "halfway there" to Lisp. ... offering any explanation as to what a scripting language is. ... execute Javascript code that modifies the current environment. ...
    (comp.lang.lisp)
  • Re: Is ECMAScript really a dialect of Lisp?
    ... various degrees in every programming language. ... popular scripting language to be "halfway there" to Lisp. ... offering any explanation as to what a scripting language is. ... execute Javascript code that modifies the current environment. ...
    (comp.lang.lisp)
  • Re: Why is Lisp not as popular as Python?
    ... I will soon begin to write a learning application with Lisp that is not ... soo trivial anymore that I would use a scripting language. ... straightly from these programming languages. ...
    (comp.lang.lisp)
  • Re: Is ECMAScript really a dialect of Lisp?
    ... various degrees in every programming language. ... popular scripting language to be "halfway there" to Lisp. ... offering any explanation as to what a scripting language is. ...
    (comp.lang.lisp)