freenode/#lisp - IRC Chatlog
Search
21:07:18
asarch
I have this code: http://paste.scsys.co.uk/582760 and I get "NIL fell through ECASE expression." What's wrong? (I'm trying to create an empty CLIM window)
21:10:57
aeth
jackdaniel: sounds like a simple check could be placed there to give a more helpful error message? Just a simple (when (null pane) (error "You don't have any pane. Try inserting (:pane :application)")) above the ecase?
21:16:26
aeth
I usually use unless as a simplification for (when (not foo) ...) not for (when (null foo) ...) which is why I didn't notice it at first
21:16:50
aeth
asarch: NULL is exactly the same thing as NOT except semantically it's for this sort of thing rather than for logical negation.
21:17:19
jackdaniel
this doesn't matter, it will be probably (when (null panes) …), because pane option (which is mutually exclusive with panes) is ensure-list'ed to panes
21:20:48
aeth
asarch: nil used to be 0, but it encouraged "pornographic programming" so it doesn't in later Lisps like Common Lisp. http://www-formal.stanford.edu/jmc/history/lisp/node3.html
21:22:45
aeth
StackOverflow, the source of all knowledge, talks about it. https://stackoverflow.com/questions/8547142/what-did-john-mccarthy-mean-by-pornographic-programming
21:22:54
aeth
"The fact that too many implementation details were leaking at a higher level, i.e. showing up too much" and "Code that uses intimate knowledge."
21:25:39
Josh_2
I don't understand what they mean by leaking implementation details at a higher level
21:26:19
aeth
Josh_2: NIL doesn't have to be 0 internally and it isn't in most modern implementations.
21:28:34
aeth
From (defun foo () NIL) (disassemble #'foo) it looks like my SBCL version's NIL is #x20100017
21:29:29
aeth
And I just pulled up a more recent SBCL and I get #x50100017 as NIL in the same commented line.
21:30:11
aeth
Compare with (defun bar () 42) (disassemble #'bar) and you see it's definitely a number (there, 42 is 84)
0:32:44
krwq
when loading file with quicklisp (possibly also asdf) why do function have to be defined in order (i.e. https://pastebin.com/qfYXGK5G but defining a first produces the error) - this makes sense to me if i executed them one by one but when loading the whole file I feel like this should just work
0:35:17
|3b|
and it returns name of output file, which you can LOAD, so (LOAD (COMPILE-FILE "foo.lisp")) is a common idiom
0:36:18
krwq
|3b|: no, does possibly :serial t in the asd file make any difference or is it just for order of files