[plt-scheme] eval and define

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Dec 28 12:31:34 EST 2006

On Dec 28, Chongkai Zhu wrote:
> The reason is that gensym  creates uninterned symbol, , i.e., a 
> symbol that is not eq?, eqv?, or equal? to any other symbol, 
> although it may print the same as another symbol.
> 
> So nik, if you really want common lisp style [...]

Actually, Common Lisp does the same thing -- this is using Allegro:

| CL-USER(1): (defvar fcn (gensym "p-"))
| FCN
| CL-USER(2): fcn
| #:|p-111|
| CL-USER(3): (eval `(defun ,fcn () (+ 1 1)))
| #:|p-111|
| CL-USER(4): (#:|p-111|)
| Error: attempt to call `#:|p-111|' which is an undefined function.
|   [condition type: UNDEFINED-FUNCTION]

If the original implementation didn't throw an error then it is
broken.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.