Stephen Compall: > Actually, if you (use-syntax (ice-9 syncase)), you should be able to > define lexical symbol-macros that expand a single symbol, even in a > set! place, something like: > > (define v #(1 2 3)) > (define-syntax v1 > (lambda (stx) > (syntax-case stx () > (_ v))))
I don't really get this syntax-rules. Do you know of any good tutorial? [I find the description in the revised report too difficult to understand] > Obviously aliasing will serve: > > (define-syntax alias-syntax > (syntax-rules () > ((_ form) > (lambda (stx) > (syntax-case stx () > (_ (syntax form))))))) > > (define-syntax defalias > (syntax-rules stx () > ((_ new form) > (define-syntax new (alias-syntax form))))) ERROR: invalid syntax (syntax-rules stx () ((_ new form) (define-syntax new (alias-syntax form)))) => error-in-evaluation (That's what guile says) > (define-syntax let-alias > (syntax-rules () > ((_ ((new form) ...) body ...) > (let-syntax ((new (alias-syntax form)) ...) body ...)))) > > (defalias v1 (vector-ref v 1)) > > (set! v1 42) > (vector-ref v 1) ; => 42 Could you explain it in more detail? Why should it work? (Or at least give me a link with such explanations) Thanks in advance M.
