libera/#commonlisp - IRC Chatlog
Search
10:08:32
frodef
I'm looking at Hunchentoot sessions, and I'm curious to understand why sessions are internally stored/referenced by an integer ID (rather than, say, the SESSION-STRING/cookie), anyone happen to know?
10:56:08
rotateq
With what in the MOP does a class track which instances it made to know what to update? I also mean the ones that weren't bound to symbols, but are still existent till the next full garbage collection.
11:10:22
Krystof
every time you ask me a question, I delete my half-finished description to answer your question
11:10:57
Krystof
the class holds a description of its current layout (slots, inheritance, etc.). That might be called a "layout" or a "wrapper" depending on context in sbcl
11:11:46
Krystof
if a class is updated, it marks the current layout as obsolete, and gets a new layout. Now the class no longer refers to the old layout, but instances do
11:12:14
Krystof
when you access an instance, part of the access protocol is checking whether the instance's layout is up-to-date or obsolete. If it's obsolete, you go into the update-instance flow
11:12:41
Krystof
if you never access an instance, it is never updated; it stays in its obsolete state (but it doesn't matter, because nothing accesses it)
11:13:17
rotateq
yes right I got that by little experimenting, also with the :allocation :class similarly
11:15:09
rotateq
so to say how i came to my question: in another talk with someone it came to singleton classes and I thought "hah, i have an idea" so I did it but the only thing that now misses is to look if there's still a referenced instance of a class anywhere
11:15:31
Krystof
so, the point is that nothing in this protocol requires the class to keep track of instances. Instead, instances keep track of which version of the class they were defined with
11:16:41
Krystof
no problem. For singletons, you could make allocate-instance throw an error, and use the class-prototype as the singleton instance?
11:17:28
rotateq
ahh right, didn't thought of allocate instance :) but made it with some other and a SINGLETON-CLASS metaclass for SINGLETON-OBJECTs
11:18:56
rotateq
then we came to this "oh so your methods aren't owned by the class?" and I thought longer, but not aware enough now how to make metaclass stuff (eg with funcallable-standard-class or standard-generic-function) to mimic even that safely for certain generic functions
11:28:43
rotateq
and i realized again why it makes absolutely no sense (by logic!) to ask for the slot-values of an instance in the (allocate-instance :before)-method :D
12:58:07
Duuqnd
Now I'm really tempted to print out a DESCRIBE output of an error object and start tossing it around.
13:04:27
moon-child
phoe: considering you wrote the common lisp condition system book, I think you have way more right to say that than I do :P
13:13:59
yitzi
I'm off to go teach. Thanks phoe, moon-child and edgar-rft for making me laugh so early here. Cheers!
13:15:49
madnificent
Any clues on where to find documentation regarding woo? (and I suspect dexador)
13:16:22
madnificent
phoe: I don't know where that is. Is that a new tool? I've seen the name before so it must be very popular! ^_^
13:17:24
madnificent
that's very exact documentation on the behaviour, but sadly any change would become a breaking change. must lean towards browser version numbers.
13:30:26
Krystof
beach: oh boy it's too long since I've talked about, let alone written, proper Lisp code
13:41:00
heisig
jackdaniel: Brilliant! I think I will explicitly allow this declaration in my loop optimization library :)
13:50:45
jackdaniel
technically correct speak is means towards the end of making the communication easier. in a spirit of this definition the fact that in common lisp conditions are "signaled" and code is organized in "packages" is very unfortunate - it is a barrier for efficient communication with people not immersed in common lisp
13:54:48
Xach
this draft RFC always made me really mad: https://datatracker.ietf.org/doc/html/draft-meyer-lisp-cons-04
13:59:33
phoe
I wonder if there could be a Lisp bot that figures out which system needs the dependency, opens its ASD file, inserts the dependency, and automatically files a quicklisp PR
14:01:41
heisig
I think I should just add extra CI jobs that load each system independently, and not just all of them in the 'usual' order.
14:01:51
jackdaniel
wasn't that we have too many 80% correct solutions and too little complete ones? at least that's what a blog post I see every 1,5 year on hackernews says
14:02:10
jackdaniel
I suppose that the curse is that I have to see it every 1,5 year, and lisp is only accidental
14:02:24
phoe
a bot that automatically files PRs for missing dependencies would be good enough I guess
14:02:55
phoe
Xach: would you accept anything like that into your workflow, or is that a silly and/or unnecessary idea?
14:03:39
phoe
jackdaniel: yes - if it can't reliably insert a dependency or make it build after inserting it, it should just file an issue IMO
14:04:34
jackdaniel
I was joking - you've said that "bot (...) files PRs, (...)it sometimes will fail to do the right thing"
14:05:48
Xach
phoe: i don't really want to automatically file PRs. i have code that automatically formats PRs for me, but I submit them "manually" to some degree.
14:10:41
rotateq
so taking a step back and proving some more critical things and let other things ripe out maybe?
14:14:33
moon-child
would be cool if you could take a parameter in the function namespace. (defun f (#'x y) (x y)). But it would make for inconsistencies w/destructuring lambda lists
14:29:56
mfiano
(subtypep foo-instance 'foo) is an error, but (subtypep foo-instance foo-instance) ;=> T,T
14:33:31
moon-child
(typep #1=#.(make-instance 'foo) #1#) gives 'bad thing to be a type specifier: #<COMMON-LISP-USER::FOO {10047D88F3}>'
14:36:39
_death
ok.. so now you're passing something that's not a type specifier, and so violates constraints in the Arguments and Values section
14:39:05
specbot
The ``Arguments and Values'' Section of a Dictionary Entry: http://www.lispworks.com/reference/HyperSpec/Body/01_ddc.htm
14:39:36
Bike
the instance is not a type specifier. as such, subtypep has been called incorrectly and the behavior is undefined.
14:39:39
phoe
but in case of (defclass foo () ()), (make-instance 'foo) is not a valid argument to SUBTYPEP
14:40:06
phoe
sbcl could possibly signal an error, something like a type-error because the argument is not of type (or symbol cons class)
14:45:51
mfiano
Thanks all, I haven't been Lisping for some months (unfortunately missed the 2-5 years), and made a mistake when I really wanted (eq (class-name (class-of instance)) type-specifier).
15:14:58
mfiano
Stupid question, but is there a library that mimics "interfaces" from other languages. What I mean, is I'd like it to be an error if the user forgets to implement a method for all of a set of generic functions for some given class/classes/etc specializers (that the library author decides on)
15:18:06
mfiano
When dealing with very composable APIs with lots of mixins etc, it can be difficult to remember to specialize them all. I could just say "their problem" when they inherit the wrong behaviors, but it would be nice to issue a warning. I know the semantics aren't exactly clear here, and that is why I'd like to look at if some libraries ever attempted to solve it, excluding some DSL/statically
15:19:33
mfiano
Maybe runtime on each invocation. I don't want to sacrifice the dynamism of Lisp for a mere correctness check.
15:32:12
mfiano
Unrelated: Just stumbled upon this, which seems, umm, interesting: https://github.com/tfeb/conduit-packages
16:43:29
madnificent
mfiano: I also work with (check-xyz) but it's for configuration files rather than classes. We want something similar in software related to our lisp code too. But very much ad-hoc.
17:00:54
madnificent
Anyone know if it's intentional that #'woo:run does not yield? it runs forever (the webserver works though)
17:03:28
etimmons
I've never used woo, but I imagine it's intentional and the thread that calls run becomes the thread in charge of the event loop
17:05:54
madnificent
etimmons: could be, though there's a stop-server command and that expects some input.