Talk:Write Yourself a Scheme in 48 Hours

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)

To do

 * Import or link to code listings
 * Update all examples that link to code listings
 * Code listings are no longer on specified site. Please update and post new site.
 * The code could be inserted by hand, but where the code should be uploaded to be accessed by others to fix the errors.

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).

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,

Then, do. The result is, as expected, 5. However, unexpectedly  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 (which also has cons cells so that   and   could potentially work).  The main functions are those which have "env" in them. 18.224.0.122 (talk) 23:39, 5 June 2009 (UTC)

Derivative Implementations

 * husk scheme - I extended the code examples from this book and wrote a more fully-featured Scheme that includes continuations, macros, etc. This is a good reference point for anyone interested in the nuts and bolts of how more advanced features could be implemented.


 * haskeem - This is another Scheme implementation derived from examples in this book, and includes a good amount of R5RS functionality.

Disclaimer - As Uwe wrote, you will learn more by writing all of this yourself. If you really want to learn Scheme, I recommend you work through the whole book on your own, and then try to implement some of these more advanced features yourself. And perhaps contribute a patch or two to one of these projects :)

Compiler Warning for the 'cdr' function
compiling listing10.hs gives the warning:

Lisp.hs:225:1: Warning: Pattern match(es) are overlapped In an equation for `cdr': cdr [DottedList [xs] x] = ...

I am pretty sure that this not a problem and can be ignored.


 * Swapping that one with  above it removes the warning.   returns 2 as expected. 75.33.209.194 (discuss) 08:40, 26 November 2013 (UTC)

many quotes are omited
The book has examples committing quotes. One example is:  which is wrong, it should be either   or. Quote is need if  is a symbol, otherwise   would be interpreted as a function name. I suppose they were deleted from the original code by mistake. 2806:106E:B:B370:7DC0:FB79:8026:6B8A (discuss) 08:02, 11 November 2022 (UTC)