[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A bug?



On Mar  8, Miki Tebeka wrote:
> It this a bug:
> 
> > (gensym)
> g47
> > (define g48 'foo)
> > (gensym)
> g48
> 
> (This is mzscheme version 101)
> 
> Or gensym does something else than I think?

If you look at the source then it doesn't chek if a symbol is already
interned, but the new one isn't:

  | Welcome to MzScheme version 101, Copyright (c) 1995-99 PLT (Matthew Flatt)
  | > (gensym)
  | g2
  | > (define g3 'g3)
  | > (define s (gensym))
  | > g3
  | g3
  | > s
  | g3
  | > (eq? g3 s)
  | #f

... makes simple macros safer ...

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
         http://www.cs.cornell.edu/eli/meaning.html        Maze is Life!