Re: [racket] Null value in macros

2013-09-25 Thread Diego Sevilla Ruiz
Hi! On 23/09/13 17:59, Matthias Felleisen wrote: Is the following code really that much more complicated that define-macro? -- Matthias Well, it certainly might not! But I don't find confident enough with syntax-case (less with syntax-parse), and I also have some code I will reuse that use

Re: [racket] Null value in macros

2013-09-23 Thread Matthias Felleisen
I wanted to show how to define auxiliary functions for syntax processing, something you do wish to know when you come from Emacs/CL On Sep 23, 2013, at 12:31 PM, Sam Tobin-Hochstadt wrote: > On Mon, Sep 23, 2013 at 11:59 AM, Matthias Felleisen > wrote: >> >> (define field-name (append-i

Re: [racket] Null value in macros

2013-09-23 Thread Sam Tobin-Hochstadt
On Mon, Sep 23, 2013 at 11:59 AM, Matthias Felleisen wrote: > > (define field-name (append-id stx "-" #'f)) > (define set-name (append-id stx #'f "-set!")) It gets even shorter when you write this as: (define field-name (format-id stx "-~a" #'f)) (define set-name (format-id stx "~a-s

Re: [racket] Null value in macros

2013-09-23 Thread Matthias Felleisen
Is the following code really that much more complicated that define-macro? -- Matthias #lang racket (require (for-syntax syntax/parse)) (define-syntax (new-field stx) (syntax-parse stx [(_ f:id) #'(new-field f null)] [(_ f:id default-value) (define field-name (append-id stx "

[racket] Null value in macros

2013-09-23 Thread Diego Sevilla Ruiz
Dear all: I've been developing a library that needs some macro coding. As I come from Common-Lisp and Elisp, I find more pleasing the old-style define-macro. The following function is used as a part of the result building of another define-macro: (define (new-field-mono f-name (default-va