Talk:Write Yourself a Scheme in 48 Hours

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

Contents

[edit] Mistake in PDF version

On page 19, the parseExpr function which should return either a parseAtom, a parseString or a parseNumber successful parse result excludes the parseNumber part (<|> parseNumber). 89.56.172.134 (talk) 20:52, 31 July 2009 (UTC)

[edit] To do

  • Import or link to code listings
  • Update all examples that link to code listings

[edit] Question

Can we create a place for the answers to the exercises?

Sounds like a nice idea -- Kowey 04:44, 21 August 2006 (UTC)
I'm working on it! Please help!! --Jkarres 03:52, 29 March 2007 (UTC)
One thought: it might be useful if we put exercises in subpages for each module. But then again, this book is pretty stable, so it doesn't matter much either way. -- Kowey 06:36, 29 March 2007 (UTC)

Thanks for this tutorial. You nearly lost me in chapter 7 (Adding Variables and Assignment: Mutable State in Haskell), but I made it. I had some experience in both Scheme and Haskell (and lots of experience in C).

[edit] Environment bug

There is a rather nasty bug in the implementation of environments for the scheme implemented by this tutorial where instead of lexical scoping, dynamic scoping was implemented. Interestingly enough, this same bug occurred in the original implementation of Lisp. Basically,

(define x 3)
(define (f n) (define x n) x)

Then, do (f 5). The result is, as expected, 5. However, unexpectedly x is now 5, too, despite R5RS scoping rules. I'm not sure how much needs to be edited to fix this. 18.224.0.122 (talk) 23:32, 5 June 2009 (UTC)

And, actually, I have a reference implementation for environments in [1] (which also has cons cells so that set-car! and set-cdr! could potentially work). The main functions are those which have "env" in them. 18.224.0.122 (talk) 23:39, 5 June 2009 (UTC)