On Apr 24, 2016, at 7:35 PM, Matthias Felleisen <matth...@ccs.neu.edu> wrote:
> 
> From the hip: Can your name-producing macro consume (val-producing-macro) and 
> then just directly generate the case-2 macro call directly: 


Can this be generalized? As a rule of thumb, is this accurate:

You can NEVER use a macro in a binding position (to produce identifiers).

And therefore the corollary:

A macro that wants to put identifiers in a binding position MUST produce the 
whole binding form for those identifiers.





On Apr 24, 2016, at 7:58 PM, Alex Knauth <alexan...@knauth.org> wrote:
> One way to do this would be to make `(name-parsing-macro x "," y "," z)` a 
> match-expander
> Does this work for you? Or is your case more complicated? 

Right, `match` is somewhat special. I'm interested in the more general problem 
(another sample posted below)


;;;;;;;;;;;;;;
#lang racket

(define-syntax-rule (binding-form _topid (_id ...))
  (define (_topid)
      (let ([_id '_id] ...)
      (displayln (format "~a bound ~a" '_topid _id)) ...)))

(binding-form foo (a b c))
(foo) ; works 

(define-syntax-rule (id-maker _a "," _b "," _c)
  (_a _b _c))

(binding-form bar (id-maker a ZIM b ZAM c))
(bar) ; fails, will treat `(id-maker ..)` expr as list of literal ids

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to