format-id from racket/syntax?

On Thu, 15 Nov 2012 20:13:40 +0100, Ray Racine <ray.rac...@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.ham...@dlr.de
____________________
 Racket Users list:
 http://lists.racket-lang.org/users

Reply via email to