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

Pages: 1-

Null list

Name: Anonymous 2011-09-14 22:31

'() is

┏━┓┏━┓
┃╱┃┃╱┃
┗━┛┗━┛


right?

Name: Anonymous 2011-09-14 22:41

Wouldn't that be (cons '() '())?

Name: Anonymous 2011-09-14 22:43

>>2
'(())

Name: Anonymous 2011-09-14 22:43

depends on which language.
I like car and cdr of nil being nil. Scheme assholes disagree.

Name: Anonymous 2011-09-14 22:43

'(nil . nil)

Name: Anonymous 2011-09-14 23:22

>>4


SCM version 5e5, Copyright (C) 1990-2006 Free Software Foundation.
SCM comes with ABSOLUTELY NO WARRANTY; for details type `(terms)'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `(terms)' for details.
;loading /usr/share/slib/require
;done loading /usr/share/slib/require.scm
;loading /usr/share/slib/require
;done loading /usr/share/slib/require.scm
;loading /usr/lib/scm/Link
;done loading /usr/lib/scm/Link.scm
;loading /usr/lib/scm/Transcen
;done loading /usr/lib/scm/Transcen.scm
(car '())

;ERROR: "/usr/lib/scm/Iedline.scm": car: Wrong type in arg1 ()
; in expression: (#@car (#@quote ()))
; in top level environment.
;STACK TRACE
1; (#@car (#@quote ()))

(cdr '())

;ERROR: "/usr/lib/scm/Iedline.scm": cdr: Wrong type in arg1 ()
; in expression: (#@cdr (#@quote ()))
; in top level environment.
;STACK TRACE
1; (#@cdr (#@quote ()))

>


I also think that would be nice. Although then that nil would probably just propagate into something else that doesn't expect a nil value.

Name: Anonymous 2011-09-14 23:38

>>6
nah. it makes writing certain recursive algorithms easier.

Name: Anonymous 2011-09-14 23:45

Woah.
(eq? '() null)→#t [mzscheme, guile doens't even have a null/nil symbol, just '()]
'()→()
()→error, tries to apply null as a procedure.

So '() is the quoted form of an unevaluatable sexp and it's nil?

Name: Anonymous 2011-09-14 23:46

Shit, ambiguous terminology. Read ``error, tries to apply some sort of weird empty space as a procedure.''

Name: Anonymous 2011-09-15 2:11

>>7
smoke nil everyday

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