There is a very nice web-based javascript version of
the great SICP textbook.
Can it also be done for
the Little Books?
The Little Schemer Chapter 1-4 Exercises: Try them in the Sandbox 1.
Pay attention to str2sx(my_string) and sx2str(my_s_expression) in the example code in the Input Box.
They are convenience functions for entering and viewing s-expressions.
On iPad if you key BackSpace the highlighted example code will disappear.
If you key Command+Arrow-Down it will stay and you can add or change code.
Use the return statement to make results appear in the Output Box. If you return the name of a function it’s definition will appear in code. Works great if you want to look up how a function is defined!
Solutions for Chapter 2 and Chapter 3 and Chapter 4.
Chapter 5 and 6: Use Sandbox 5 with solutions from Chapters 2–4 included.
Solutions for Chapter 5 and
Chapter 6.
Chapter 7 and 8: Use Sandbox 7 with isEqual from Chapter 5 replacing isEq.
Solutions for Chapter 7 and
Chapter 8.
Chapter 9 and Beyond: Use Sandbox 9 with answers from Chapter 7 and 8 included.
Solutions for Chapter 9 and
Chapter 10.
And of course a little Scheme interpreter,
without define, just like in the book.
From The Seasoned Schemer: here is Chapter 11, Chapter 12, Chapter 13, Chapter 14, Chapter 15, Chapter 16 and Chapter 17.
The Little Javascripter by Douglas Crockford has a table
with transformation rules from Scheme to Javascript. For instance we use null instead of ‘() in Scheme.
And cdr(a, s) instead of (cdr a s).
All primitives (car cdr cons isAtom isEq isNull) from Chapter 1 “Toys” are available in the Sandboxes.
Do not use “or” in Chapter 2, instead use || in Javascript. Same for “and” and &&.
If you want to try Scheme there is a great site at Try Scheme.
On iPad turn off smart quotes if you want to code in Scheme: Go to Settings - General - Keyboard, and toggle off “Smart Punctuation”.
Or use (define my_atom (quote atom)).