[racket] Generate Syntax Identifiers

From: Ray Racine (ray.racine at gmail.com)
Date: Thu Nov 15 14:35:56 EST 2012

of course ...

Thanks.


On Thu, Nov 15, 2012 at 2:20 PM, Tobias Hammer <tobias.hammer at dlr.de> wrote:

> format-id from racket/syntax?
>
>
> On Thu, 15 Nov 2012 20:13:40 +0100, Ray Racine <ray.racine at gmail.com>
> wrote:
>
>  What little macro-fu I ever had abandoned me long back.
>>
>> Say I want to generate an identifier, e.g. add a standard suffix.
>>
>> So if my identifier is `hello', the suffix `-tmp' is appended forming
>> `hello-tmp'.
>>
>> The following gets there but I seem to recall using an easier technique in
>> days of lore.
>>
>>  [(_ name:id e0:expr e1:expr ...)
>>  (with-syntax ((name-tmp (datum->syntax stx (string->symbol (string-append
>> (symbol->string (syntax->datum #'name))
>>
>>               "-tmp")))))
>>
>> Is there an easier way to append together syntax?
>>
>>
>> Thanks,
>>
>> Ray
>>
>
>
> --
> ------------------------------**---------------------------
> Tobias Hammer
> DLR / Institute of Robotics and Mechatronics
> Muenchner Str. 20, D-82234 Wessling
> Tel.: 08153/28-1487
> Mail: tobias.hammer at dlr.de
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121115/07778d2d/attachment.html>

Posted on the users mailing list.