<div dir="ltr">*cough* my test cases at the moment amount to pressing the keys and seeing that the appropriate actions are being taken. I suppose I will need to write official tests.</div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Sun, Jan 5, 2014 at 1:32 PM, Matthias Felleisen <span dir="ltr"><<a href="mailto:matthias@ccs.neu.edu" target="_blank">matthias@ccs.neu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
It is an unusual way to break syntax but I can't think of a serious drawback off the top of my head. (I am sure Ryan and Matthew can think of one.) Does it pass your test cases?<br>
<div><div class="h5"><br>
<br>
On Jan 5, 2014, at 1:21 PM, Sean Kanaley wrote:<br>
<br>
> Ha! The below solution is a macro-making macro that re-syntaxifies "params ..." to "belong to" the inner macro:<br>
><br>
> (define-syntax-rule (make-commands name params ...)<br>
> (define-syntax (name inner-stx)<br>
> (syntax-case inner-stx ()<br>
> [(_ (c f) (... ...))<br>
> (with-syntax ([(ps (... ...)) (datum->syntax inner-stx (syntax->datum #'(params ...)))])<br>
> #'(list (cons (symbol->string 'c)<br>
> (λ (ps (... ...)) f))<br>
> (... ...)))])))<br>
><br>
> I'm not sure if this is the canonical solution, but nevertheless I think it's pretty awesome that this is possible and seems to work.<br>
</div></div>> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br>
</blockquote></div><br></div>