Scheme macros with 2 params -



Scheme macros with 2 params -

can define macro 1 param left , 1 right part of macro? want write kind of in programs:

(test = 10)

to define new variables tried write macro:

(define-syntax = (syntax-rules () ((a _ b) (define b))))

but i've got error "bad syntax in: ="

since form determined first element you'd have problems test not beingness bound.

the right way this:

(= test 10)

you write macro this:

(define-syntax = (syntax-rules () ((_ b) (define b))))

there go. without horrible infix syntax.

macros scheme

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -