zv / SICP-guile

SICP in Guile & Emacs Lisp
677 stars 49 forks source link

Streams in Guile #11

Open gcohara opened 4 years ago

gcohara commented 4 years ago

Hi, Guile uses a (couple of) different implementation of streams from the book, so you end up with strange behaviour when doing exercise 3.51. So, I thought it might be worth mentioning that you can implement your own special forms using e.g

(define-syntax stream-cons
  (syntax-rules ()
    ((_ a b) (cons a (delay b)))))

and that you should then have streams that behave like those in the book. Thanks for writing this btw, I'm very pleased I made the switch from Racket!

ghost commented 4 years ago

@gcohara

I have a bit of shameless self -promotion you may like:

https://gitlab.com/Lockywolf/chibi-sicp/-/blob/master/index.org