guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Syntax-rules generate symbol


From: Dmitry Bogatov
Subject: Syntax-rules generate symbol
Date: Mon, 09 Sep 2013 20:19:40 +0400
User-agent: mu4e 0.9.9.5; emacs 24.3.1

Hello!

Here is my implementation of for loop. I found lisp really extremely
flexible, but there is one problem --- more often then not I do not need
var part, so I do not care how it would be named --- all I care is that
it will not shadow any other bindings.

I think I can do it(did not tryed it) with `define-macro` and uninterned
symbols, but it mean give up beauty of syntax-rules.

Masters of syntax-rules and syntax-case, please give me peace of advice.

(define-syntax for
    (syntax-rules (in => as)
        ([_ (pattern as var in list) exp ...]
         [for-each (lambda (var) (match var (pattern exp ...))) list])))

PS. Please, keep in CC, I am not subscribed.

--
Best regards, Dmitry Bogatov <address@hidden>,
Free Software supporter and netiquette guardian.
        git clone git://kaction.name/rc-files.git --depth 1
        GPG: 54B7F00D
Html mail and proprietary format attachments are forwarded to /dev/null.

Attachment: pgp57eq_egSXT.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]