define-syntax Questions
4
Solved
I've read JRM's Syntax-rules Primer for the Merely Eccentric and it has helped me understand syntax-rules and how it's different from common-lisp's define-macro. syntax-rules is only one way of imp...
Sinter asked 25/9, 2008 at 4:7
2
Solved
I found myself defining syntax parameters with identical definitions except for their name so I decided to write a macro to make this simpler:
(define-syntax (test-case-parameter stx)
(syntax-par...
Expansion asked 25/9, 2016 at 18:52
3
Solved
What's the simplest way to define a capturing macro using define-syntax or define-syntax-rule in Racket?
As a concrete example, here's the trivial aif in a CL-style macro system.
(defmacro aif (...
Cataldo asked 18/11, 2013 at 17:44
1
Solved
To give a simple example:
(define-macro-variable _iota 0) ; define-macro-variable does not really exist
(define-syntax (iota stx)
(syntax-case stx ()
((iota)
(let ((i _iota))
(set! _iota (+ i...
Caveator asked 14/8, 2013 at 17:47
2
Solved
I've been told that "call/cc" can be used to implement arbitrary control flow constructs so I'm trying to implement all such constructs using "call/cc" but I'm having trouble. Assuming I didn't hav...
Frosting asked 29/7, 2011 at 3:27
1
Solved
I'm working though SICP and wanted to try out some of the examples in guile. I'm trying the stream examples and wanted an implementation for cons-stream, which I got from this StackOverflow questio...
Swiftlet asked 21/5, 2011 at 13:18
4
Solved
R5RS gives proposed macro definitions for library forms of syntax:
http://schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-10.html#%_sec_7.3
Which also defines letrec, in a very complicated wa...
Lavine asked 14/5, 2010 at 15:57
1
Solved
I have been writing Common Lisp macros, so Scheme's R5Rs macros are a bit unnatural to me. I think I got the idea, except that I don't understand how one would use vector patterns in syntax-rules:
...
Marybethmaryellen asked 26/3, 2010 at 21:11
3
Solved
Can a macro be written in Scheme (with define-syntax, for example) which will take expressions like this:
(op a b c d e f g h i j)
And yield expressions like this as output?
(op (op (op (op (op...
Franzen asked 4/12, 2008 at 10:50
1
© 2022 - 2024 — McMap. All rights reserved.