freenode/#lisp - IRC Chatlog
Search
14:34:36
frgo
Hi all - ASDF question: How do I tell ASDF that a system is already loaded? (I have CLX on AllegroCL loaded using (require :clx) but now ASDF does not know that CLX is already there...) - TIA !
14:50:09
Xach
frgo: it's possible that the clx that comes with allegro is not the "portable" clx that asdf would load.
14:51:16
frgo
Xach: Yeah - I am just running into issues now. Hm - I need to make McCLIM run on AllegroCL.
14:54:30
frgo
Well, I have a whole range of apps running using AllegroCL (using Franz' Allegrgraph DB). Now I want to have a fancy UI as a "control panel".
14:55:58
Xach
Allegro CL comes with its own CLIM and GUI system, I think they are likely more complete and usable than McCLIM. (I have not used any of them so I don't know for sure.)
14:59:54
Xach
I think if you asked Franz support they would steer you to their other thing, I have the impression they are trying to move customers off CLIM.
15:01:15
beach
Xach: It is not clear that McCLIM is much less complete than Allegro these days. McCLIM has had a lot of work done lately. And certainly, McCLIM is better in many respects in that it is faster, and it uses the Xrender extension for fonts and anti-aliased drawing.
15:01:20
Xach
beach: do you have reference material for the inspiration behind https://github.com/robert-strandh/SICL/blob/master/Code/Loop/combinatory-parsing.lisp ?
15:02:09
Xach
I have used that technique a lot for ad hoc query compilation but have not read the foundational materials.
15:07:59
Xach
Cool, I was using monads and didn't know it! I got so much smarter just by knowing the right name!
15:20:05
Xach
https://lispblog.xach.com/post/147048601608/querying-plists is a variation - sometimes I use functions directly rather than involving a compilation step
16:27:58
ebrasca
beach: Hi. I undestand this documentation but not sure what protocol is. http://metamodular.com/CLOS-MOP/
16:37:44
beach
I need to figure out a way to explain this to you, because if you don't know it, you are going to produce very bad code indeed. But dinner is imminent, so I don't have time to do it today.
16:49:53
beach
Usually, if you define a "stack" module, you get an error if you pop from an empty stack.
16:51:42
beach
Or else, POP does not return a value and there is a separate operation for returning the top element of the stack.
16:58:05
Josh_2
"these techniques work by (i) defining a set of object types and operations on them, which can support not just a single behavior, but a space or region of behaviors-this is commonly called a protocol;"
17:19:24
Josh_2
you have a class, generic functions and methods that work on that class, that's a protocol. I think
17:37:08
beach
ebrasca: Exactly, just like it is better to signal an error when you attempt to take the top of an empty stack.
17:37:31
aeth
(/ x y) might return an infinity if they're both floats and something like float-features:with-float-traps-masked is used. e.g. (float-features:with-float-traps-masked (:underflow :overflow :inexact :invalid :divide-by-zero :denormalized-operand) (/ 1f0 0f0)) ; in SBCL this gives a compilation style-warning because it catches it at compilation time, but it also returns #.SINGLE-FLOAT-POSITIVE-INFINITY
17:38:23
aeth
beach: sorry, I thought this was on the earlier (yesterday?) discussion about it being unspecified, and that was probably the edge case why
17:38:37
beach
ebrasca: If you return NIL, you can't distinguish between the case where NIL is the top element of the stack, and the case when the stack is empty.
17:39:37
mfiano
sadly a lot of C libraries rely on these values and float traps has to be disabled for proper interfaces
17:40:33
aeth
nil is the only falsey value so it shows up pretty much anywhere where you'd want false
19:39:32
aeth
ebrasca: the problem with returning nil is that it could be a legitimate value, especially false or the empty list. There are afaik four common options here: raise a condition (or whatever the exact terminology is), return two values with the second value also being nil, use a keyword (which only works if it's not arbitrary data like a hash-table value), or return a (usually user-provided) default value
19:42:26
aeth
You can also do fancier things like return (values) as in no-value but that's normally treated as nil so it would require fancy handling. Afaik, only multiple-value-call and multiple-value-list would be able to detect (values) without just automatically replacing it with nil.
19:44:55
aeth
What's particularly interesting in some APIs is combining option #4 with option #1, i.e. having an error unless a default value is provided