Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

NIL=() Considered Harmful

Name: Anonymous 2013-04-06 15:29

Consider function READ, which parses a list of elements or returns NIL on syntax error. Such READ function would provide no way to read an empty list, because return would be indiscernible from error. But Lisp indulges creation of such read functions, because checking for NIL is much easier than checking for exception.

Moreover, it breaks strong-typing, making harder to guess author's intention.

Name: Anonymous 2013-04-06 15:31

The only strong typing in Lisp is ( and )!

Name: Anonymous 2013-04-06 15:38

Lambda Calculus hints that TRUE and FALSE should be defined as functions and IF should accept only them. All object should be explicitly converted to boolean.

Name: Anonymous 2013-04-06 16:30

CL hash-table also returns NIL on failure, meaning you cant easily store empty list.

Name: Anonymous 2013-04-06 16:35

again
page is not loading completely fucking shitchan

Name: Anonymous 2013-04-06 16:55

https://groups.google.com/group/clojure/browse_thread/thread/816bd7a076bbfade?hl=en&noredirect=true
The context defines the meaning of
nil intended by the person coding that function.  It does nothing to
ensure that the coder has thought about what the function will do if
nil is used with another meaning, and it does nothing to ensure that
consumers of that function will use nil in the way the coder intended.
 I have found this to be a relatively common source of bugs that pass
test cases (because test cases are written by the coder who has a
specific intention in mind) but show up in the field.

Name: Anonymous 2013-04-06 17:33

If it ain't zero, it's one.

Name: Anonymous 2013-04-06 18:04

Again showing whenever someone says something is "meant for practical use" they really mean "its a pile of incredible shit thats too scared to admit its own faults but I think everyone else is using it and I'm scared I'll be called a pussy for using something designed correctly".

Hence, Common Lisp is the PHP of the prefix notation languages.

Name: Anonymous 2013-04-06 19:03

>>8
Scheme is a useless pile of academic shit.

Name: Anonymous 2013-04-07 2:49

>>8
Common Lisp also has a confusing lot of NIL/CONS related predicates, like there is CONSP, LISTP, ATOM and NULL, while TYPECASE discerns between LIST, CONS, BOOLEAN and NULL. Then ATOM considers NIL an atom, so if you have some code that should be invoked on every list, you can miss some empty lists.

NIL=() ("nil punning", as Rich Hickey calls it) is the single worst Lisp wart. Just use Scheme/Racket, even if currently Scheme compilers are slower, absence of nil-punning should make compilation easier.

Name: Anonymous 2013-04-07 2:51

>>10
Then there is a notion of "proper" and "improper" lists.

Name: Anonymous 2013-04-09 22:00

>>11
Nice dubs, bro!

Name: Anonymous 2013-04-09 22:59

NIL is the empty list because lists are terminated by NIL.
(a b c d)
(a . (b . (c . (d . ()))))
(b . (c . (d . ())))
(c . (d . ()))
(d . ())
()

Name: Anonymous 2013-04-10 0:20


(a b c d)
(a . (b . (c . (d . T_PAAMAYIM_NEKUDOTAYIM))))
(b . (c . (d . T_PAAMAYIM_NEKUDOTAYIM)))
(c . (d . T_PAAMAYIM_NEKUDOTAYIM))
(d . T_PAAMAYIM_NEKUDOTAYIM)
T_PAAMAYIM_NEKUDOTAYIM

Name: Anonymous 2013-04-10 6:11

>>14
You are a cool PHP WIZARD NO SUCK MY JAVA BALLS

Name: Anonymous 2013-04-10 7:58

WHAT IS A COOL

Don't change these.
Name: Email:
Entire Thread Thread List