The Spirit in the Computer
Frequently Asked Questions

What’s Currying?

It sounds like you’re interested in functional programming. The comp.lang.functional FAQ answers this question and many more.

What’s an ACCU Mentored Developers Project?

The project centres on an email reflector. People sign up as either observers or students, and start receiving emails—typically it seems to be three or four a day. Students are assigned exercises from The Wizard Book and submit their answers to the reflector for comment.

Mentors and observers are on the list to offer expert advice.

Sounds Interesting—Can I Join?

Yes, if you’re a member of the ACCU. Head over to the mentored developers page on the website and follow the instructions.

Can you supply an implementation of “put” and “get”?

All the source code for the exercises, including implementations of library functions required, can be found here.

Why isn’t “nil” working?

The quick answer is: nil is no longer part of Scheme, use ‘() instead. The long answer follows…

Early examples in Chapter 2 use nil as a list terminator, but when these examples are run using (e.g.) MIT Scheme, you get:

;Unbound variable: nil

Similarly, using () or null in place of nil may work on some implementations, but neither is portable. The Wizard Book addresses the issue in this footnote

It’s remarkable how much energy in the standardization of Lisp dialects has been dissipated in arguments that are literally over nothing: Should nil be an ordinary name? Should the value of nil be a symbol? Should it be a list? Should it be a pair? In Scheme, nil is an ordinary name, which we use in this section as a variable whose value is the end-of-list marker (just as true is an ordinary variable that has a true value). Other dialects of Lisp, including Common Lisp, treat nil as a special symbol. The authors of this book, who have endured too many language standardization brawls, would like to avoid the entire issue. Once we have introduced quotation in section 2.3, we will denote the empty list as ‘() and dispense with the variable nil entirely.

Since this was written, nil has been excised from the Scheme standard—but the bottom line holds: use ‘(), not nil. In an email to the accu-sicp list, Mike notes:

It’s a troublesome thing, this nil/null/’() business. Scheme48 and
scm don’t define null, and guile defines it but as a procedure akin to
common lisp’s null (to go with its nil which behaves like cl’s nil,
which itself is distinct from ‘()—maybe this had something to do
with fsf’s plans to re-do emacs in guile). I think the best bet is to
replace the authors’ use of nil with ‘().

What’s the difference between Lisp and Scheme?

Sorry, I don’t have a definitive answer to that. Scheme is a Lisp dialect. The best known Lisp dialect is probably Common Lisp—which is rather bigger than Scheme. Here are some relevant links:

Holger had this to say about the difference between Scheme and Common Lisp:

I think a good comparison is the difference between Modula-2 and Ada (only that with Scheme v CL it is a bit larger a difference). One language is designed of elegance of simplicity while the other is meant for industrial strength application developments (CL has the added ‘feature’ of carrying a few decades of historical cruft with it while Ada might suffer more from design by committee).

Mike also notes:

My impression so far is that if I do much Scheme I’ll probably end up using different implementations for different things. Guile has a lot of good things for GNU/Linux environments, but is not much good if I want the program to run on windows, I think, and hasn’t the full numeric tower (this may have changed in versin 1.8 just out). I’ve started using scsh instead of bash or perl for scripts, and it runs on scheme48. And then there’s bigloo which looks like the most promising of the scheme compilers for targetting the .Net runtime.

This situation contrasts with Common Lisp where I think I can just pick one of sbcl or GNU clisp and stick with it (although sbcl seems more complete while it sounds like GNU clisp has a better windows port, but at least the code wouldn’t need to change as much between them—if at all?). And the tools seem to be more mature for CL (slime looks wonderful), the module system is standardized, and there seems to be more handy libraries, which also look more mature. Someday, assuming a Scheme community continues to work away as they are now, I think I’d rather use Scheme than CL, but right now it looks like CL is the more serious language for general use, so that’s on my list to learn when we’re finished here (or sooner).

Implementing the Fibonacci Series is nice, but can I write a GUI using Scheme?

I know what you mean. I guess Common Lisp is a better starting point. Holger has had some good results using LTK, which describes itself as “The easy way to do Lisp GUI programming”, and provides a Common Lisp binding for the Tk graphics toolkit. Apparently no knowledge of Tk is required.

Holger also notes:

I vaguely remembered that there was some gtk binging for guile. Google found me:

SICP is great. Can you recommend any other material for a programming language enthusiast?

Lambda the Ultimate calls itself a “programming languages weblog”. I found an interesting thread on reading matter here.