[plt-scheme] eval and define

Eli Barzilay eli at barzilay.org
Thu Dec 28 13:22:59 EST 2006


On Dec 28, nik gaffney wrote:
> > 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.
> 
> yes you're right. looks like its a problem with slime, as the
> example gives an error when run from the shell, yet 'works' when
> using slime. . ..

Each occurrence of #:foo in the input should generate a new
uninterned symbol, so when you enter (eq '#:foo '#:foo) you should get
NIL.  (You can only get T with (eq '#1=#:foo '#1#).)  Slime is
probably keeping track of uninterned symbols and match them up by name
behind your back.

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


More information about the plt-scheme mailing list