Keyword arguments in function headers and applications are constrained to take a single argument; macro patterns in syntax-case (which define-syntax-rule is based on) and syntax-parse are more flexible in how they can use keywords. Making them accept keyword arguments would remove this flexibility. I suspect you could write a new form for parsing macros with function-header-like patterns, however. Alternately, use define-simple-macro from syntax/parse/define and parse keyword arguments with ~optional and ~seq.
Carl Eastlund On Wed, Aug 10, 2011 at 12:58 PM, Jon Rafkind <rafk...@cs.utah.edu> wrote: > Can `define-syntax-rule' support keyword arguments? Preferably keywords > with default values. > > (define-syntax-rule (foo #:x [x 5]) x) > (foo) > (foo #:x 2) > > If this sounds like a good idea and could be implemented I can give it a > whirl. _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users