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
0:37:08
|3b|
ACTION doesn't even get an warning from LOADing the example you pasted, is real code public anywhere? (on SBCL)
0:37:48
mfiano
I know about `closer-mop:slot-definition-initargs` which will give me the initargs given a class. But how would I discover initargs not present in the class? Like if I specialize a `reinitialize-instance` method, I would like to get those valid initargs as well. Basically I'm trying to get all initargs that can be supplied to `make-instance`.
0:38:26
krwq
|3b|: let me check if that's the warning or error - either way I'd expect debugger not to pop up
0:39:08
krwq
|3b|: actually i might be calling it when I think about it - i often put tests as top-level asserts under the function itself
0:39:10
Bike
make-instance initargs are slot initargs but the keys of allocate-instance and initialize-instance and shared-initialize
0:39:46
Bike
probably take all the initargs, and then look at the applicable methods for those three functions, and get the keywords out of those
0:40:28
krwq
|3b|: i think this might be related to the asserts, let me put them in the bottom of file and see if it works
0:42:14
mfiano
If this isn't vague enough, we're writing a DSL for a game engine, and we want compile-time type-checking for the part of the language that generates forms to create instances.
0:44:06
Bike
https://github.com/slime/slime/blob/master/contrib/swank-arglists.lisp#L780-L800 here's how swank does it.
0:45:55
krwq
|3b|: thanks |3b| - completely forgot about the asserts, i wrote the file a while ago and had to do some changes today when I hit this
0:46:37
mfiano
Ah, would you recommend your sandalphon parser, or something else? I always get frustrated when looking for things to parse lambda lists and just write my own special purpose hacks.
1:05:49
mfiano
Ok. I'm not very familiar with the MOP. What will give me the lambda list for reinitialize-instance?
1:08:07
Bike
you need the lambda lists for the methods of reinitialize-instance relevant to the particular class you're looking at
1:09:10
Bike
you can calculate those methods with compute-applicable-methods(-using-classes), then use mop:method-lambda-list
1:11:02
no-defun-allowed
how does the CLIM listener handle drawing graphical representations of values?
1:18:53
mfiano
Bike: I can get c-a-m to work, but I can't figure out how to get c-a-m-u-c to work. I just get a no applicable method error. Can you provide an example of using this?
1:20:02
aeth
I can parse function lambda lists except for &aux. It wouldn't take much to add method support because I designed it for my extended lambda list syntax that basically is the defmethod lambda list for types instead of classes and with the addition of &key and &optional support, which defmethod doesn't support.
1:20:38
aeth
It would take some work to librarify it, though, because I basically use it for define-function and related things, like local function bindings with the same syntax.
1:27:05
fiddlerwoaroof
no-defun-allowed: it uses a thing called "presentations" to associate a value with a particular display on the screen
1:27:26
fiddlerwoaroof
I'm not quite sure how the default representation of, e.g., repl results is handled
1:28:28
fiddlerwoaroof
Because WITH-OUTPUT-AS-PRESENTATION associates a value with the arbitrary display produced by its body, iiuc
1:31:17
mfiano
Bike: Stupid question. Why do I get an applicable method specialized on SB-PCL::SLOT-OBJECT in addition to the class specializer when computing methods for reinitialize-instance?