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
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
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
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 "
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
5 matches
Mail list logo