<div dir="ltr">Be careful using gensym to create unique variables. If you compile a program that uses a gensym'd variable, you can run into problems arising from odd interactions between uninterned symbols and the marshalling/unmarshalling process for bytecode files. It's always safe to use generate-temporaries (or generate-temporary from racket/syntax for just one identifier), even in compiled programs.<br>
</div><div class="gmail_extra"><br clear="all"><div>Carl Eastlund</div>
<br><br><div class="gmail_quote">On Fri, Sep 27, 2013 at 1:23 AM, Niitsuma Hirotaka <span dir="ltr"><<a href="mailto:hirotaka.niitsuma@gmail.com" target="_blank">hirotaka.niitsuma@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Also I found<br>
<br>
(define-macro (syntax-gensym k)<br>
(let ((var (gensym)))<br>
`(syntax-return<br>
,k<br>
,var)<br>
))<br>
<br>
can generate unique variable.<br>
<br>
Usage<br>
<br>
(define-syntax-computation testing<br>
(computation-rules ( )<br>
(( _ v )<br>
(syntax-do<br>
(var <- (syntax-gensym))<br>
(syntax-return var)<br>
))))<br>
<br>
2013/9/26 Asumu Takikawa <<a href="mailto:asumu@ccs.neu.edu">asumu@ccs.neu.edu</a>>:<br>
<div class="HOEnZb"><div class="h5">> On 2013-09-26 12:54:45 +0900, Niitsuma Hirotaka wrote:<br>
>> How to use unique name variable within srfi-53 ?<br>
><br>
> I'm not sure why that PLaneT package has that behavior, but if you just<br>
> want to generate new identifiers, you can use the built-in<br>
> `generate-temporaries` function:<br>
><br>
> Welcome to Racket v5.90.0.9.<br>
> -> (generate-temporaries '(x y z))<br>
> '(#<syntax x4> #<syntax y5> #<syntax z6>)<br>
><br>
> Cheers,<br>
> Asumu<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br>
</div></div></blockquote></div><br></div>