This is more of a general Scheme question...
Let's say I have the following definitions:
#;1> (define magic 42)
#;2> (define s '(foo bar ,magic))
Now I want to replace ",magic" with its value. If I write this directly with
backquote and unquote, it's easy and straightforward:
#;3> `(foo bar ,magic)
(foo bar 42)
So far, so good. But: how do I do the same with the existing list s?
The following doesn't work:
#;4> `s
s
#;5> `,s
(foo bar (unquote magic))
...and I understand *why* they don't work, but I can't figure out how to take s
and transform it into (foo bar 42). Maybe I'm stupid, but I just don't see it.
Is it possible? Or do I need to do something entirely different?
The underlying idea is that I want to write some sort of DSL, using
s-expressions, but it should be possible to insert ,values into it that get
evaluated as usual. E.g.
(jmp #xC000)
should be functionally the same as
(define foo #xC000)
(jmp ,foo)
Thanks,
--Hans
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users