[plt-scheme] getting argument identifiers

From: Stephen De Gabrielle (spdegabrielle at gmail.com)
Date: Fri Oct 17 06:12:08 EDT 2008


I was wondering if there is a way of defining a function or macro that
could get the identifiers for the arguments it is passed,

> (define x 2)
> (print-identifier-and-value x)

Please forgive me if this is the dumb question I suspect it is.

What I  was trying to do was define a macro that would dump whatever I
stuffed into it. (instead of using printf functions all through my
It can get unwieldy so I wanted to print the identifiers too.

 (define-syntax dump-all
  (syntax-rules ()
    [(_ x ...)
       (printf "Dump:~N")
         (lambda (i) (printf "item:~n~v~n" i))
         (list x ...))
       (printf "Dump End~n")

(define x "dfd")
(dump-all 2 4 x)



Posted on the users mailing list.