[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
syntax-case problems
From: |
Ingo Ruhnke |
Subject: |
syntax-case problems |
Date: |
14 Sep 2002 12:11:20 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Hi,
I am trying to define a simple macro which should transform a:
(mydefine a 5)
into:
(define a-var 5)
The following code should be correct for that and it works in
mzscheme, but doesn't work in Guile 1.6.0:
(use-modules (ice-9 syncase))
(define-syntax mydefine
(lambda (expr)
(syntax-case
expr ()
((_ var value)
(with-syntax ((newvar (string->symbol
(string-append
(symbol->string (syntax-object->datum
(syntax var)))
"-var"))))
(syntax (define newvar value))))
)))
guile> (mydefine a 5)
ERROR: encountered raw symbol in macro output a-var
ABORT: (misc-error)
Anything I am doing wrong or is this a bug in guile? Is there anywork
around beside using define-macro or eval?
--
WWW: http://pingus.seul.org/~grumbel/
Games: http://pingus.seul.org/~grumbel/gamedesigns/
JabberID: address@hidden
ICQ: 59461927
- syntax-case problems,
Ingo Ruhnke <=