libera/#commonlisp - IRC Chatlog
Search
20:05:46
mfiano
Not that I think I'd need to do type-checking considering the stringified source data is coming from the correct application I am parsing into lisp objects, but it makes me wonder if I should anyway.
20:07:50
mfiano
Like one slot is fed any of "none"i, "available", "unavailable", and encoded as any of :none, :available, :unavailable. But if my program logic is wrong and tries creating an instance with bad data, I have no way to type check.
20:10:11
mfiano
Though not sure if it makes sense to type check decoding if it is symmetric with the input.
20:14:08
mfiano
I'm also not sure if it even makes sense to specify an :encoder _and_ :decoder slot. The decoder just puts it into the original form it was encoded from. That logic can be derived with a closure or object representing the transcoding method.
20:19:25
mfiano
My plan was to build a CST, producing an AST afterwards to do type-checking/generation phases on. I think I need to sketch out the pipeline better...it might be overly complex like all my compiler theory implementations are :/
21:43:03
Guest74
ugh, I hate when you can't interrupt a slime repl. This is why I shouldn't have my editor in the same process, let alone my window manager.
1:45:25
Josh_2
Does anyone have an example of using multiple :around methods combined with call-next-method?
1:45:53
Josh_2
I only just realized that call-next-method when inside of an :around looks for the next most applicable :around method before executing the primary (by default) :facepalm:
2:21:23
zacque
Josh_2: You can play around with it using hierarchical classes like animal, dog, poodle, cat, persian-cat
2:22:23
zacque
Then define a generic function like MAKE-SOUND or PRINT-NAME for specialising it on different classes
2:24:18
zacque
The trick in understanding the `Standard Method Combination` is to understand the interplay of "shadowing" and "accumulative" effects for both primary and auxiliary methods
2:25:29
Josh_2
I though (call-next-method) invokes the primary method when in :around, but it doesn't, it looks for the next most applicable :around and if it doesn't find one then it calls the most applicable primary
2:27:41
zacque
Also, I suppose you can always define a "non-crazy" order with DEFINE-METHOD-COMBINATION
2:28:34
Bike
but usually if i don't understand a method combination thing i just figure out what the form looks like based on the method combination definition
2:30:11
Bike
like if your applicable methods are two arounds, two primaries, a before, and an after, what you get is (call-method #<around1> #<around2> (make-method (progn (call-method #<before>) (multiple-value-prog1 (call-method #<primary1> #<primary2>) (call-method #<after>)))))
2:31:00
Bike
in other words, if you use call-next-method and the next method is an around, you call that, but otherwise you call the whole before/primary/after situation
2:35:06
Bike
if you get this system https://github.com/sellout/method-combination-utilities you can use method-combination-expand to get that tree i wrote out manually