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 question. However when I type this into guile I get:
guile> (define-syntax cons-stream
(syntax-rules ()
[(cons-stream x y) (cons x (delay y))]))
ERROR: invalid syntax ()
ABORT: (misc-error)
I have no idea what's wrong with this - I've tried replacing () with '(), removing the [ ], but it still doesn't work even though it seems to be valid R5RS. I'm currently on guile 1.8.7, I can't see a package for v2.0.1 which the GNU docs mention, could this be why its not working for me?