kb 19.05.2012 09:49

Таки дошли руки открыть SICP на ноуте чтоб примеры поделать (хотя в голове тоже полезно было, особенно долго не мог понять этот ваш flatmap, почему-то). И тут ошибка: нет такого символа в mit-sicp, как nil.

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

Recommended by: @dorfe
1. ojab 19.05.2012 09:51 YGG!

use racket, luke

2. kbojab /1 19.05.2012 09:53

will look into

Do you really want to delete ?