[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is gentemp or gensym "safe"?
From: |
Martin Grabmueller |
Subject: |
Re: Is gentemp or gensym "safe"? |
Date: |
Wed, 25 Apr 2001 06:22:19 +0200 |
> From: Rob Browning <address@hidden>
> Date: 24 Apr 2001 15:02:58 -0500
>
> I'm nearly finished implementing srfi-11 using define-macro, and while
> let*-values was fairly easy to implement elegantly, let-values is
> somewhat uglier, and I need to create safe temporary values in the
> expansion. Is that possible with gensym or gentmp?
They are not really safe, but see below.
> The documentation for gentemp seems off, indicating it takes 2
> optional args, when in fact it takes only one.
For me it does take 0 to 2 args.
guile> (gentemp)
t0
guile> (gentemp "foo")
foo1
guile> (gentemp "foo" '#(() () ()))
foo2
> Also, if you specify a prefix to gensym, it starts generating very
> simple symbols.
The symbols are always very simple. Whether that's a good idea, I am
not sure.
guile> (gensym)
g0
guile> (gensym "foo")
foo1
> These are guaranteed not to conflict with the existing bindings,
> right?
The implementation of gentemp looks like it is avoiding already
defined symbols, but it obviously doesn't. What's wrong here?
guile> (gensym "foo")
foo1
guile> (gensym "foo")
foo2
guile> (define foo3 1)
guile> foo3
1
guile> (gensym "foo")
foo3
Regards,
'martin
- Is gentemp or gensym "safe"?, Rob Browning, 2001/04/24
- Re: Is gentemp or gensym "safe"?,
Martin Grabmueller <=
- Re: Is gentemp or gensym "safe"?, Rob Browning, 2001/04/25
- Re: Is gentemp or gensym "safe"?, Rob Browning, 2001/04/25
- Re: Is gentemp or gensym "safe"?, Martin Grabmueller, 2001/04/25
- Re: Is gentemp or gensym "safe"?, Rob Browning, 2001/04/25
- Re: Is gentemp or gensym "safe"?, Michael Livshin, 2001/04/25
- Re: Is gentemp or gensym "safe"?, Rob Browning, 2001/04/25