<phoe>
"The type unsigned-byte or the type (unsigned-byte *) is the same as the type (integer 0 *), the set of non-negative integers."
<francogrex>
to be clear: I expect type-of to tell me that trhe content is (unsigned-byte 8) and not (INTEGER 0 4611686018427387903)
<francogrex>
and if I had tried to put an (INTEGER 0 4611686018427387903) in a unsigned-byte array, to tell me Whoa there! what are you doing?
<phoe>
TYPE-OF returns the type of the value, not the array that it is held in
<beach>
francogrex: AREF is used to access the array, and the result of that access is then handed to TYPE-OF.
<phoe>
try calling array-element-type on the array
<beach>
francogrex: So TYPE-OF does what it can to report a type of that integer.
Inline_ has joined #commonlisp
ttree has quit [Remote host closed the connection]
<beach>
francogrex: There is no obligation for the implementation to report the type of an integer between 0 and 255 as (UNSIGNED-BYTE 8).
ttree has joined #commonlisp
<francogrex>
ok I see. so all is ok adn beach as you had said, earlier, the type-of is the confusing part
<phoe>
yeah, TYPE-OF for integers is specified in a funky way, AFAIK for any non-bit integer N it's allowed to return (INTEGER N N) which is technically correct
MajorBiscuit has joined #commonlisp
<francogrex>
correct but not quite specific
<beach>
Yes, TYPE-OF has a lot of freedom. And indeed, SBCL reports the type of something like 234 as that integer type you mentioned.
<phoe>
it's actually the most specific you can get! no other integer is of that type
* phoe
ducks
<phoe>
but yes to be serious now, it's less of a question "what type is this integer" and "what element type is this array specialized to"
<beach>
phoe: I seem to recall that (INTEGER N N) is not allowed, but I can't remember why I think that.
<phoe>
because 42 is e.g. of type (integer -2137 2137) which is kinda arbitrary, and then of type (integer 300 300), and then an infinite other number of types
<phoe>
and it seems that points 1, 2, 3, 4, 5 are all satisfied with (type-of 42) → (INTEGER 42 42)
<beach>
Yeah, re-reading it, I don't remember why I excluded that possibility.
Inline__ has joined #commonlisp
Oladon has quit [Read error: Connection reset by peer]
Oladon has joined #commonlisp
amb007 has joined #commonlisp
Inline_ has quit [Ping timeout: 248 seconds]
amb007 has quit [Ping timeout: 248 seconds]
Inline_ has joined #commonlisp
francogrex has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)]
Inline__ has quit [Ping timeout: 260 seconds]
amb007 has joined #commonlisp
aartaka has quit [Ping timeout: 248 seconds]
aartaka has joined #commonlisp
Inline__ has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
Inline_ has quit [Ping timeout: 260 seconds]
<jackdaniel>
beach: maybe clim spec remanents in the memory
<jackdaniel>
presentation-type-of is specified to return "the most useful typr"
<jackdaniel>
tupe
<beach>
AHA! That explains it. Thanks.
<jackdaniel>
type :/
<jackdaniel>
and integer is here more uswful than integer 42 42
<jackdaniel>
typing on phone
<beach>
And it doesn't correct stuff like that?
<beach>
I thought all smartphones had a sophisticated AI in them these days.
<jackdaniel>
mine is not sophisticated - I connect via ssh and log into my tmux session
<jackdaniel>
with irssi :)
<beach>
I see (sort of).
<phoe>
jackdaniel: hi5
<jackdaniel>
time for a moomin story, ttyl
aartaka has quit [Ping timeout: 252 seconds]
Inline_ has joined #commonlisp
santiagopim has quit [Remote host closed the connection]
seletz has quit [Ping timeout: 248 seconds]
Inline__ has quit [Ping timeout: 248 seconds]
Inline__ has joined #commonlisp
aartaka has joined #commonlisp
Inline_ has quit [Ping timeout: 252 seconds]
aartaka has quit [Ping timeout: 260 seconds]
rendar has joined #commonlisp
rendar has quit [Changing host]
rendar has joined #commonlisp
aartaka has joined #commonlisp
Oladon has quit [Quit: Leaving.]
ttree has quit [Read error: Connection reset by peer]
Inline_ has joined #commonlisp
Inline__ has quit [Ping timeout: 260 seconds]
|3b|` is now known as |3b|
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 260 seconds]
aartaka has quit [Ping timeout: 252 seconds]
aartaka has joined #commonlisp
silasfox has joined #commonlisp
amb007 has joined #commonlisp
Inline__ has joined #commonlisp
aartaka has quit [Ping timeout: 260 seconds]
rainthree has joined #commonlisp
aartaka has joined #commonlisp
random-nick has joined #commonlisp
amb007 has quit [Ping timeout: 260 seconds]
Inline_ has quit [Ping timeout: 246 seconds]
Inline_ has joined #commonlisp
Inline__ has quit [Ping timeout: 260 seconds]
jello_pudding has quit [Ping timeout: 246 seconds]
pjb has joined #commonlisp
Inline__ has joined #commonlisp
jello_pudding has joined #commonlisp
Inline_ has quit [Ping timeout: 248 seconds]
Inline_ has joined #commonlisp
amb007 has joined #commonlisp
Inline__ has quit [Ping timeout: 252 seconds]
amb007 has quit [Ping timeout: 246 seconds]
seletz has joined #commonlisp
Inline__ has joined #commonlisp
amb007 has joined #commonlisp
gxt has quit [Remote host closed the connection]
gxt has joined #commonlisp
Inline_ has quit [Ping timeout: 260 seconds]
Lycurgus has joined #commonlisp
Inline_ has joined #commonlisp
tibfulv has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 260 seconds]
tibfulv has joined #commonlisp
Inline__ has quit [Ping timeout: 248 seconds]
thuna` has joined #commonlisp
jmdaemon has quit [Ping timeout: 248 seconds]
<phoe>
does anyone need any Common Lisp tutoring? I realized that I kinda like this style of teaching and, according to the two people who I've already done that with, I have a decent f2f teaching style and they seem to like the way I do things
amb007 has joined #commonlisp
<jackdaniel>
me me take me
amb007 has quit [Ping timeout: 246 seconds]
danieli has quit [Quit: Alpine Linux, the security-oriented, lightweight Linux distribution]
<Madsy>
Looks like a teacher found a student :)
<phoe>
Madsy: well, truth be told I'd gladly take some lisp lessons from jackdaniel
<Madsy>
Ah, right. I sometimes forget who the regulars are here
<Madsy>
I need to learn more about CL debugging/debuggers at some point
<splittist>
I think, as in every language, there is the right way, and there is the way everyone does it (with print statements...)
aartaka has quit [Ping timeout: 260 seconds]
<pjb>
It depends on the kind of bug.
ec_ has quit [Remote host closed the connection]
azimut has quit [Remote host closed the connection]
<pjb>
sometimes, just watching at the value of a single variable in the debugger is enough to understand the bug.
<pjb>
but sometimes, you need to have a dynamic view of the process.
ec_ has joined #commonlisp
<phoe>
actually with the CL interactive debugging and the ability to redefine a function with an additional (break) I don't remember the last time I've done printf-style debugging in CL
<phoe>
I don't even use the stepper
aartaka has joined #commonlisp
<splittist>
If only there was some teacher who could tell us how to do that...
<phoe>
(as in, I didn't ever really need to)
<phoe>
splittist: I know, right
<phoe>
I wish I could read a book about this too
<mariari>
I like break, but I've found it freezes the repl (at least in sly), though sly stickers don't have the same issue
<phoe>
huh, it doesn't do it in slime
<Madsy>
Yeah to be honest, I hate print-debugging. Anything else is better
<mariari>
really?
<phoe>
can you do (break) and actually hit Enter in the repl a few times to check?
MajorBiscuit has quit [Quit: WeeChat 3.6]
<mariari>
sure
azimut has joined #commonlisp
<phoe>
in slime the REPL still responds, I do not know about sly
<mariari>
yeah, it's the same with sly's stickers, I did not realize I was in the dynamic environment, that is neat
silasfox has quit [Ping timeout: 248 seconds]
amb007 has quit [Ping timeout: 248 seconds]
MajorBiscuit has joined #commonlisp
amb007 has joined #commonlisp
Inline__ has joined #commonlisp
Inline_ has quit [Ping timeout: 248 seconds]
amb007 has quit [Ping timeout: 246 seconds]
Bungg has joined #commonlisp
Bungg is now known as Bung
zacque has quit [Quit: Goodbye :D]
Dynom_ has joined #commonlisp
Dynom_ is now known as Guest2931
<mfiano>
Random thought: when I eventually come back to CL I will just use a bunch of ASSERTs at the top level instead of one of the plethora of test libraries I was never satisfied with.
<rainthree>
mfiano: That's what I have been doing, but I think it slows down the whole thing after many asserts are there. So now I am using rt (which I ve heard is used by ironclad too) https://dl.acm.org/doi/10.1145/121983.121988
<pjb>
mariari: you can use (com.informatimago.common-lisp.interactive.interactive:repl) instead of (cl:break)
<phoe>
mfiano: it's fun, but only for stable software - I mean, until you have a thousand tests and you'd like to get a list of all tests that failed instead of having your tests crash on the first failure without a chance to continue executing next tests
tyson2 has joined #commonlisp
<jackdaniel>
you may put asserts in test functions, agreed, but asserts in runtime are not test, just protection from rogue invariants
<jackdaniel>
(answering phoe and rainthree, op did not suggest that :)
<phoe>
yes, I didn't mean asserts in runtime code, I meant a test suite composed of a file with a ton of toplevel calls to ASSERT
<jackdaniel>
or rather only rainthree, phoe did not
<jackdaniel>
oh well, you beat me to it
<rainthree>
okay
<phoe>
:D
<pjb>
When you run tests, you have two kinds of failures: some test failures denote a problem with the tested software, but some other test failures denote a problem with the testing software, the test itself. This means that when you run tests, sometimes you will want to debug the tested software, and sometimes you will want to debug the testing software (the test itself). Condition handling must be different for either case.
<pjb>
And of course, in a CI, you don't want to enter the debugger at all, just get a tally.
<Bike>
yeah, a good dumb test framework is more like (if test-form (push 'test-name *successes*) (push 'test-name *failures*))
<pjb>
(push 'test-name (if test-form *successes* *failures*)) should work too ;-)
<pjb>
hmm, nope, only in clisp IIRC.
<jackdaniel>
if - place like no other
<jackdaniel>
crosswords of a kind
<jackdaniel>
crossroads
amb007 has joined #commonlisp
<phoe>
I remember complaining here some time ago that IF is not a place
<Bike>
how do you handle the subforms being different in different branches?
amb007 has quit [Ping timeout: 255 seconds]
<Bike>
i guess you could even have to deal with something like (if foo (car a) (values b c))
<mariari>
pjb: thanks, yeah that would do it, I seem to even get auto completion in that. I forgot if I thanked you for your advice last time, but thanks
<phoe>
Bike: (setf (if foo bar baz) newval) → (if foo (setf bar newval) (setf baz newval))
<phoe>
plus minus multiple evaluation
<phoe>
I assume the setf expansion could get-setf-expansions of the two branches inside IF and then expand into something like the above
<pjb>
Yes, the problem is that almost all the setf-expanders would have to deal with multiple possible forms, and this could explode when you have embedded IFs.
<frodef>
Does anyone happen to have experience with Hunchentoot and SSL certificate chain, on sbcl/linux? Seems to me that the server only offers up the server certificate, not the entire certificate chain in the server pem file...
Inline_ has joined #commonlisp
<pjb>
you can concatenate pem files to contain the whole chain.
<frodef>
pjb: yes, the chain is in the pem file, but apparently the chain is ignored by hunchentoot and/or cl+ssl or whatever it is.
Inline has quit [Ping timeout: 248 seconds]
<pjb>
I see. Yes, that's quite possible.
<pjb>
Patches are welcome.
<frodef>
pjb: are you maintaining hunchentoot and/or cl+ssl ?
<pjb>
Neither.
<pjb>
But I'm sure the maintainers will welcome them.
<frodef>
ok :)
waleee has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
<mariari>
pjb: decided to play with the (...interactive:repl) from the terminal since any condition sly adds on tends to make it easy to break out, do you know if it's easy to just add comint-mode on top, to make it feel like a native repl, if so I might do a similar trick for one of my projects
<frodef>
Seems a call to (cl+ssl:use-certificate-chain-file ssl-cert-file) does the trick. Funny thing is, this wasn't required a few days ago, I believe.
random-nick has quit [Ping timeout: 260 seconds]
Inline__ has joined #commonlisp
<pjb>
mariari: you would have to deal with the streams. The core of slime, is the *terminal-io* -> #<two-way-stream input #<swank/gray::slime-input-stream #x302002363B3D>, output #<swank/gray::slime-output-stream #x3020023637AD> #x30200235B76D>
<pjb>
mariari: and the corresponding process on the emacs side.
amb007 has joined #commonlisp
<pjb>
mariari: perhaps you could use: C-u slime RET sbcl --eval (ql:quickload …) --eval (...interactive:repl) RET
Inline_ has quit [Ping timeout: 260 seconds]
dipper has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 252 seconds]
Inline_ has joined #commonlisp
Inline__ has quit [Ping timeout: 252 seconds]
gxt has quit [Remote host closed the connection]
gxt has joined #commonlisp
<mariari>
thank you I have to jet now, it's getting late here. I really should look at the core of slime
ec_ has quit [Ping timeout: 255 seconds]
aartaka has quit [Ping timeout: 248 seconds]
aartaka has joined #commonlisp
ec_ has joined #commonlisp
Oladon has joined #commonlisp
nij- has joined #commonlisp
scymtym has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
Guest2931 has quit [Quit: WeeChat 3.7.1]
Brucio-61 has joined #commonlisp
causal has quit [Quit: WeeChat 3.7.1]
karlosz has quit [Read error: Connection reset by peer]
nij- has quit [Ping timeout: 248 seconds]
Bung has quit [Quit: Leaving]
amb007 has joined #commonlisp
tyson2 has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
random-jellyfish has joined #commonlisp
<anddam>
by sole virtue of having read about CL on the web (but never going through a whole book) and listening to Functional Geekery podcast I applied for a CL job that did not require previous Lisp experience
<pjb>
(incf anddam)
<anddam>
let's see how it goes
<phoe>
anddam: congrats, tell us how it goes
<anddam>
just wanted to leave this out here to make you know I am possibly stealing one of your jobs
<phoe>
oh no, somebody call the lisp police!
<anddam>
I have to see first hand what this damn allure is
<anddam>
meanwhile, downloading Visual Studio 2022 at current job
<anddam>
:'-(
doyougnu has quit [Ping timeout: 260 seconds]
amb007 has joined #commonlisp
waleee has quit [Ping timeout: 252 seconds]
amb007 has quit [Ping timeout: 248 seconds]
Oladon has quit [Quit: Leaving.]
tyson2 has quit [Remote host closed the connection]
doyougnu has joined #commonlisp
<beach>
The allure of Common Lisp, you mean?
attila_lendvai has joined #commonlisp
azimut has quit [Ping timeout: 255 seconds]
doyougnu has quit [Ping timeout: 260 seconds]
Oladon has joined #commonlisp
CptKirk has joined #commonlisp
Inline__ has joined #commonlisp
CptKirk has quit [Ping timeout: 248 seconds]
Inline_ has quit [Ping timeout: 252 seconds]
CptKirk has joined #commonlisp
danieli has joined #commonlisp
cage has joined #commonlisp
amb007 has joined #commonlisp
aartaka has quit [Ping timeout: 260 seconds]
amb007 has quit [Ping timeout: 252 seconds]
aartaka has joined #commonlisp
thuna` has joined #commonlisp
<anddam>
yes, and the whole image based programming
<beach>
But you must have tried it out while reading some books, yes?
<phoe>
I assume the Lisp on the Web book was mentioned up there
nij- has joined #commonlisp
nij_ has joined #commonlisp
nij- has quit [Killed (NickServ (GHOST command used by nij_))]
nij_ is now known as nij-
Inline_ has joined #commonlisp
<beach>
Oh, I missed that this referred to a particular book.
Inline__ has quit [Ping timeout: 248 seconds]
amb007 has joined #commonlisp
<phoe>
yeah, it's kind of a lesser-known book
pfd has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
<jcowan>
MOP question (forgive me for not digging through the MOP docs): how can I set the condition reporter for a condition class after creating it?
Sauvin has quit [Ping timeout: 260 seconds]
<Bike>
that's not in mop. no portable way to do it that i know of. you can write a print-object method of course.
<Bike>
it would for example be conforming for an implementation to implement :report as a print-object method rather than some property of the condition class, i think
random-jellyfish has quit [Quit: Client closed]
<jcowan>
arrgh.
<phoe>
jcowan: probably the only workaround I can think of is (:report (lambda (c s) (my-report c s)) and then (defmethod my-report (...) ...)
<jcowan>
The trouble is that in circumstances when the condition reporter would be invoked, print-object would not be called
<jcowan>
phoe: Which is not post hoc. If I want to attach a condition reporter to some existing condition, it seems I am S.O.L.
<phoe>
oh, yes
<phoe>
that's undoable in portable CL
<pjb>
phoe: (:report my-report)
<phoe>
you need to specify it a DEFINE-CONDITION time
<phoe>
pjb: welp, yes :D
<jcowan>
In particular, changing the condition-reporter for a system defined condition cannot be done.
Inline__ has joined #commonlisp
<phoe>
yes, and that's pretty much by design I think
<phoe>
I can't imagine it would be conforming to do anything like that even if it had a portable interface
cercopith has joined #commonlisp
<phoe>
what's the problem you are trying to solve though?
<Bike>
"in circumstances when the condition reporter would be invoked, print-object would not be called" - i don't understand this. the standard actually basically says that it's print-object that invokes the reporter
<Josh_2>
Good Morning :sunglasses:
Inline_ has quit [Ping timeout: 248 seconds]
amb007 has joined #commonlisp
Cymew has quit [Ping timeout: 246 seconds]
amb007 has quit [Ping timeout: 252 seconds]
attila_lendvai has quit [Ping timeout: 248 seconds]
<jcowan>
Bike: I don't see anything like that in 9.1.3
<phoe>
"Condition reporting is mediated through the print-object method for the condition type in question, with *print-escape* always being nil. Specifying (:report report-name) in the definition of a condition type C is equivalent to (defmethod print-object ((x c) stream) (if *print-escape* (call-next-method) (report-name x stream)))
<phoe>
"
ec_ has quit [Remote host closed the connection]
<jcowan>
ah, okay, I missed that altogether: thanks!
<Bike>
also, print-object is actually always used if *print-pretty* is false, per 22.1.2. it's just the implementation can skip it with built in classes since there's no standard way to detect otherwise.
ec_ has joined #commonlisp
amb007 has joined #commonlisp
szkl has joined #commonlisp
<Bike>
defining methods on print-object for standard condition classes is still not allowed cos of the package rules, tho. you're still SOL on that.
<jcowan>
Okay, fair enough
<jcowan>
(or rather, very annoying, but there it is)
attila_lendvai has joined #commonlisp
aartaka has quit [Ping timeout: 252 seconds]
amb007 has quit [Ping timeout: 260 seconds]
aartaka has joined #commonlisp
rainthree3 has joined #commonlisp
rainthree has quit [Ping timeout: 248 seconds]
amb007 has joined #commonlisp
aartaka has quit [Ping timeout: 260 seconds]
aartaka has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
<jcowan>
Bike: wait, why is it illegal to add a method to print-object for a standard class? sbcl prints a warning and then ignores the method, but print-object says "Implementations are free to add methods for other classes."
<Bike>
print-object allowing _implementations_ to add more methods doesn't really say anything about what programmers can do, also
<frodef>
Bike: Next sentece allows users to write PRINT-OBJECT methods, no?
<Bike>
next sentence of what?
MajorBiscuit has quit [Ping timeout: 248 seconds]
igemnace has quit [Remote host closed the connection]
<frodef>
Of what you quoted from the PRINT-OBJECT page. After it talks about _implementations_, next sentence is about _users_
attila_lendvai has quit [Ping timeout: 260 seconds]
<frodef>
(page in CLHS, I mean)
<Bike>
i didn't quote anything from the print-object page. sorry, i'm not sure what you're referring to. i mentioned 22.1.2
<Bike>
users can of course define print-object methods, as long as they're not applicable when the arguments are all direct instances of standard classes
<phoe>
yeah but 11.1.2.1.2.19 forbids anyone from defining a method on a standard generic function that's applicable for standard conditions
<phoe>
...unless you have some crazy custom stream as the second argument, but I don't think you're gonna do this
<beach>
As I recall, you are not allowed to specialize to the stream class either.
<frodef>
Bike: ok sorry, I probably misunderstood.
<phoe>
yes, I by "crazy custom stream" I meant a custom stream subclass
<Bike>
it is not a problem
<phoe>
something you could achieve e.g. with a Gray stream defined by you
<Bike>
there's "Implementations are free to add methods for other classes. Users may write methods for print-object for their own classes if they do not wish to inherit an implementation-dependent method." which is what jcowan quoted, but of course it says "their own classes"
<jcowan>
yes, got it now
<phoe>
e.g. (defmethod print-object ((c condition) (s my-magical-stream)) ...) is permissible
<Bike>
i am kind of curious why you want to define custom methods for standard conditions. maybe you can sort of hack it with pretty print dispatching.
<jcowan>
I'm finally writing the implemenetation of ISLisp I've been thinking about for some years now. It sits on top of CL
mathrick has quit [Ping timeout: 248 seconds]
<jcowan>
ISLisp has a standard generic function "report-condition", which I will implement using cl:print-object, and simply document that you can't set the condition reporter for any standard class.
<phoe>
pretty meaningful, I guess; does your ISLisp not have its own standard condition types though?
<phoe>
(I know nothing about ISLisp)
<jcowan>
Fortunately they are a subset of CL's.
knusbaum has joined #commonlisp
<phoe>
well, in the worst case you could (define-condition islisp:warning (cl:warning) ()) if you want to isolate the "raw" CL condition types
<phoe>
at which point you can defmethod print-object the hell out of islisp:warning
<jcowan>
There are only three ISLisp classes that are problematic: one for general vectors, one for general non-vector arrays, and one for arbitrary non-vector arrays..
cercopith has quit [Ping timeout: 260 seconds]
<jcowan>
It's understandable that the last two aren't classes, but it seems broken to me that general vectors aren't a class.
nij- has quit [Ping timeout: 252 seconds]
mathrick has joined #commonlisp
CptKirk has quit [Ping timeout: 246 seconds]
pfd has quit [Ping timeout: 260 seconds]
tyson2 has joined #commonlisp
tormenatur has joined #commonlisp
ec_ has quit [Remote host closed the connection]
ec_ has joined #commonlisp
epony has quit [Remote host closed the connection]
ttree has joined #commonlisp
amb007 has joined #commonlisp
nij- has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
igemnace has joined #commonlisp
amb007 has joined #commonlisp
Bungg has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
attila_lendvai has joined #commonlisp
amb007 has joined #commonlisp
Bung has joined #commonlisp
Bungg has quit [Quit: Leaving]
amb007 has quit [Ping timeout: 252 seconds]
cosimone has joined #commonlisp
random-nick has joined #commonlisp
scymtym has quit [Ping timeout: 248 seconds]
Brucio-61 has quit [Ping timeout: 260 seconds]
Bung has quit [Quit: Leaving]
tyson2 has quit [Remote host closed the connection]
attila_lendvai has quit [Ping timeout: 260 seconds]
Inline_ has joined #commonlisp
jeosol has joined #commonlisp
aartaka has quit [Ping timeout: 260 seconds]
aartaka has joined #commonlisp
Inline__ has quit [Ping timeout: 248 seconds]
Inline__ has joined #commonlisp
Inline_ has quit [Ping timeout: 248 seconds]
Brucio-61 has joined #commonlisp
jeosol has quit [Quit: Client closed]
epony has joined #commonlisp
rainthree3 has quit [Ping timeout: 248 seconds]
igemnace has quit [Remote host closed the connection]
CptKirk has joined #commonlisp
CptKirk has quit [Ping timeout: 248 seconds]
aartaka has quit [Ping timeout: 260 seconds]
<nij->
(with-open-file ..) can I make it wait, if the file hasn't ( but will soon) existed?
<Bike>
put a (loop until (probe-file ...)) in front of it i guess?
mariari has quit [Ping timeout: 248 seconds]
<Josh_2>
Catch the signalled condition over and over until it opens :P :joy:
cosimone` has joined #commonlisp
matt` has joined #commonlisp
cosimone has quit [Ping timeout: 248 seconds]
ec_ has quit [Remote host closed the connection]
ec_ has joined #commonlisp
<yitzi>
Maybe file-notify?
waleee has joined #commonlisp
mariari has joined #commonlisp
cosimone` has quit [Remote host closed the connection]
cosimone` has joined #commonlisp
<nij->
Bike should I (sleep 0.01) too? Or just let it loop is fine?
<kakuhen>
nothing wrong with constantly polling besides the burned cpu cycles, I guess
Volt_ has joined #commonlisp
<Bike>
nij-: well, if you really want to be intelligent about it file-notify is probably the better solution.
<kakuhen>
but it involves cffi and doing things on fs events is full of race conditions so i dont like it out of principle
<kakuhen>
(continuing from my comment, not responding to phoe)
cosimone` has quit [Ping timeout: 260 seconds]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
ec_ has quit [Ping timeout: 255 seconds]
thuna` has quit [Remote host closed the connection]
rendar has quit [Ping timeout: 252 seconds]
ec_ has joined #commonlisp
Posterdati has quit [Ping timeout: 248 seconds]
<nij->
Hmm I haven't looked at the source code, but I'd imagine that there's always a loop on the lisp side checking if any changes happened.
<Shinmera>
uh, no matter what it's going to involve ffi. you need to talk to the OS for this, and that happens via ffi.
<Shinmera>
nij-: no
<nij->
If we must use a loop, why not just (loop until (probe-file ))?
<nij->
?!
<nij->
Could you share a bit on how you prevent using a lisp loop?
<Shinmera>
depends on the api but at least the way file-notify works is that you call a function that suspends the thread until something cool happens.
<Shinmera>
you can also just check if something cool has happened and if not just continue doing other useful stuff.
<nij->
There must be a loop to check "until", no?
<Shinmera>
not really, you just wait until the os wakes up your thread saying it has something for you.
<Shinmera>
kakuhen: that library does not look complete at all.
<jackdaniel>
*** os speaking *** something cool happened; carry on
<nij->
but then lisp needs a loop to pay attentiont to the os, right?
<Shinmera>
no?
<jackdaniel>
nij-: when you type read-char, do you need to put it in a loop?
<Shinmera>
the os takes the thread, notes down "when x event happens, wake thread" suspends the thread, then lets other programs do useful things until x happens. then it wakes the thread again.
_cymew_ has quit [Ping timeout: 260 seconds]
Posterdati has joined #commonlisp
ec_ has quit [Ping timeout: 255 seconds]
euouae has joined #commonlisp
<nij->
oh i see
<nij->
jackdaniel that analogy is nice. Thanks :)
<pjb>
nij-: it may be worth learning some unix or linux system stuff.
ec_ has joined #commonlisp
<euouae>
is it possible to use dependencies like closer-mop in an .asd file?
<phoe>
:depends-on (#:closer-mop)
<euouae>
phoe, for the load operation itself to use closer-mop
<phoe>
:defsystem-depends-on (#:closer-mop)
<euouae>
oooh nice, thank you!
Lord_of_Life has quit [Excess Flood]
Lord_of_Life has joined #commonlisp
<euouae>
but what if I have defun's that use closer-mop in the .asd file?
<euouae>
do I have to place them elsewhere and load them?
<pjb>
euouae: avoid that.
<pjb>
You can avoid it easily, by making those sources in a normal system, and to depend on it in your system.
<phoe>
define two systems, depend on closer-mop in the first, :defsystem-depends-on to define the other system
<phoe>
...why would you need closer-mop to define an ASDF system though
<euouae>
it's a documentation coverage system
<phoe>
that doesn't answer my question yet
<euouae>
and I need to inspect slot documentation
<phoe>
...during ASDF system creation time?
<euouae>
I couldn't think of an easier way to hack it
<euouae>
because I need the list of packages that the system defines
<euouae>
(the main system)
<phoe>
an ASDF system doesn't define packages
<euouae>
sigh
<euouae>
the system loads files that create packages
<euouae>
I need to differentiate between external dependencies and main packages, and that was done with prepare-op/load-op hooks
<phoe>
yes, and the easiest way of grabbing that list is (list-all-packages) before the system is loaded and (list-all-packages) after the system is loaded
<phoe>
and then SET-DIFFERENCE the two
<euouae>
that's what I did
<phoe>
why need the MOP then, let alone at ASDF system definition time?
<euouae>
because then I want to look up documentation of the symbols, and slot docs are not standard
<euouae>
the ASDF system is a CI action
<phoe>
what do you mean that is is a CI action? you mean that invoking some operation on the system is a CI action?
<phoe>
because, if yes, then these will not require DEFSYSTEM-DEPENDS-ON
<phoe>
because a DEFSYSTEM-DEPENDS-ON dependency is one that's required for ASDF to be able to eval the DEFSYSTEM form at all
<euouae>
loading the doc coverage system reports on documentation coverage
<phoe>
whereas a normal DEPENDS-ON dependency is required to perform operations on it, not to be able to create the instance of a system object
<euouae>
that's the action that is done after every commit e.g. (or whenever)
<phoe>
can you post your code somewhere? I still don't understand everything
<euouae>
it's a (defsystem ... :output-files (doc-coverage.txt) :perform (find-undocumented-symbols))
kg7ski has joined #commonlisp
<phoe>
this doesn't look like a DEFSYSTEM-DEPENDS-ON
<euouae>
the (find-undocumented-symbols) uses your set-difference solution
<euouae>
which requires before/after (list-all-packages) when loading other another system
Oladon has quit [Quit: Leaving.]
scymtym has joined #commonlisp
tyson2 has joined #commonlisp
<euouae>
if I go with pjb's approach I won't need defsystem-depends-on. I understand your point now phoe
jmdaemon has joined #commonlisp
shka has quit [Ping timeout: 248 seconds]
nij- has quit [Ping timeout: 255 seconds]
amb007 has joined #commonlisp
azimut has joined #commonlisp
morganw has joined #commonlisp
amb007 has quit [Ping timeout: 260 seconds]
matt` has quit [Remote host closed the connection]
nij- has joined #commonlisp
nij- has quit [Remote host closed the connection]
nij- has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
random-nick has quit [Ping timeout: 260 seconds]
nij- has quit [Remote host closed the connection]
nij- has joined #commonlisp
torhex-pasmul[m] has joined #commonlisp
pve has quit [Quit: leaving]
ec_ has quit [Remote host closed the connection]
ec_ has joined #commonlisp
amb007 has joined #commonlisp
<euouae>
Is there any standard notation (in documentation, text, etc) to refer to a slot of a class? is it class.slot?
<euouae>
or anything that is commonplace?
<phoe>
the symbol that is the name of that slot
amb007 has quit [Ping timeout: 252 seconds]
<phoe>
if anything, slots are a property of a class, and they're kind of an implementation detail that often is not meant to be documented
<phoe>
accessor functions are the real stuff, even more so since they often have logic for handling and accessing the raw data that is actually stored in the slots
<euouae>
okay let me think about it
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
<euouae>
is there a way to set documentation to accessors other than setf'ing the documentation form?
<euouae>
or should I use some defclass extension that makes it easier to do so?
azimut has quit [Remote host closed the connection]
gxt has quit [Write error: Connection reset by peer]
Devon has quit [Ping timeout: 252 seconds]
<phoe>
accessor functions are just functions
<phoe>
so SETF DOCUMENTATION 'FUNCTION is gonna work well
cyberbanjo has joined #commonlisp
<phoe>
unless you wanna document methods, at which point that's gonna be the method object and 'T
amb007 has joined #commonlisp
cyberbanjo has quit [Remote host closed the connection]
azimut has joined #commonlisp
gxt has joined #commonlisp
amb007 has quit [Ping timeout: 246 seconds]
<pjb>
euouae: accessors are methods on a generic function.
<pjb>
so you can document them by declaring the generic function: (defgeneric my-accessor (object) (:documentation "foo")) (defclass coo () ((x :accessor my-accessor)))
<euouae>
but there's symbol clashes
<euouae>
two different classes can have the same accessor
<phoe>
yes
<euouae>
for different purposes, so you also need to document the methods themselves
<phoe>
and that's by design
<pjb>
METHOD on a single generic function!
<phoe>
no, for one and the same purpose
<euouae>
OK your'e saying it's a design mistake to have the same accessor for different classes for different purposes?
<pjb>
but of course, using SETF DOCUMENTATION 'FUNCTION may be more homogeneous if you use it for all your docstrings (as beach would recommend).
<phoe>
euouae: yes
<phoe>
it's a major design mistake, it should be two different functions at that point
<euouae>
how do you know that?
<pjb>
euouae: the key word is "for different purposes"!
<phoe>
know what exactly?
<euouae>
How do you know it's a design mistake?
<pjb>
euouae: if two slots share the same accessor for the same purpose, it's better.
<pjb>
eg. the name of a person and the name of a dog should share an :accessor name
<phoe>
when designing a protocol/interface, a function in that interface should have a single well-designed purpose, no matter what sorts of arguments it is called with
<pjb>
on the other hand, the car of a cons cell and the car of a taxi driver should probably be cons-car and driver-car, since those two CARs are totally different things.
<phoe>
methods are just an implementation detail that allows generic behavior
<phoe>
and what pjb just said
<euouae>
okay, and other than that, you'd set the documentation with (setf (documentation (symbol-function 'my-accessor) 'function) "...")
<euouae>
alright, thank you for the help. This is nice
<euouae>
Although I spent a lot of time trying to figure out system deps and using closer-mop to obtain slot documentation, it turns out that documenting accessors is the way to go
<phoe>
very yes
<euouae>
cool!
<pjb>
euouae: the slot can have a documentation that is different than the accessor.
<pjb>
euouae: for the slot, you would document the :initarg and :initform for example. You may talk about the relationship of this slot with other slots. Neither of this would concern an accessor.
<euouae>
pjb, how to document :initarg and :initform? how do you mean?
<phoe>
just mention them in the documentation string as appropriate
<euouae>
I see, what would require such documentation? Isn't it more or less obvious?
<phoe>
it is hence it isn't done often
Inline_ has joined #commonlisp
<phoe>
+ slots are an implementation detail
<pjb>
(defclass coo () ((x :initform :length :initarg 42 :accessor coo-size :documentation "The slot X stores the length of the COO. Its default is 42; it can be initialized with :LENGTH; the accessor is COO-SIZE")))
<pjb>
(defgeneric coo-size (object) (:documentation "Return the size of the object")) (defgeneric (setf coo-size) (new-value object) (:documentation "Set the size of the object"))
<euouae>
pjb, all that can be deducted by the source code and that's where you'd be reading the docstring anyway
<euouae>
I guess I can't think of complicated enough situations for this
<pjb>
euouae: but DOCUMENTATION can be called without reading the source code!
<euouae>
yeah but to get the slot object you need the mop right?
cyberbanjo has joined #commonlisp
<pjb>
euouae: see for example git@github.com:mmontone/lisp-system-browser.git
<pjb>
Yes, the MOP will be used.
<euouae>
well that's the catch there. anyway although I do want to push for more documentation I think the slot documentation is low priority
Inline__ has quit [Ping timeout: 248 seconds]
mathrick has quit [Ping timeout: 248 seconds]
amb007 has joined #commonlisp
kaskal- has joined #commonlisp
kaskal has quit [Ping timeout: 246 seconds]
rgherdt has quit [Remote host closed the connection]