jackdaniel changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
reb has joined #commonlisp
beach has quit [Ping timeout: 246 seconds]
Lord_of_Life has quit [Ping timeout: 255 seconds]
Lord_of_Life has joined #commonlisp
random-nick has quit [Ping timeout: 255 seconds]
herjazz has joined #commonlisp
lottaquestions has quit [Quit: Konversation terminated!]
lottaquestions has joined #commonlisp
lottaquestions has quit [Quit: Konversation terminated!]
lottaquestions_ has joined #commonlisp
waleee has quit [Ping timeout: 260 seconds]
NicknameJohn has joined #commonlisp
seok has joined #commonlisp
<seok> is https://cffi.common-lisp.dev/manual/cffi-manual.pdf not working for anyone else?
micro has quit [Ping timeout: 258 seconds]
micro has joined #commonlisp
<jcowan> seok: the machine is up, the server is down
<seok> ehh
<seok> ok
<seok> thanks
<jcowan> traceroute vs. isitdownrightnow.com
herjazz has quit [Quit: leaving]
tibfulv has quit [Remote host closed the connection]
tibfulv has joined #commonlisp
habamax has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1.50)]
tibfulv has quit [Remote host closed the connection]
tibfulv has joined #commonlisp
azimut has quit [Ping timeout: 252 seconds]
beach has joined #commonlisp
beach has quit [Killed (NickServ (GHOST command used by beach`!~user@2a01:cb19:a62:6300:af41:859e:6cda:4bea))]
beach has joined #commonlisp
zaymington has joined #commonlisp
<jcowan> Thanks!
<beach> Sure.
<beach> jcowan: Membership in a generation is just a set membership. All the usual techniques for set membership can be used. Using the object address is just one way.
attila_lendvai has joined #commonlisp
Pixel_Outlaw has quit [Remote host closed the connection]
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
rtypo has quit [Ping timeout: 258 seconds]
pfdietz has quit [Quit: Client closed]
rainthree has joined #commonlisp
moon-child is now known as Mondenkind
mathrick has quit [Remote host closed the connection]
mathrick has joined #commonlisp
shka has joined #commonlisp
jonatack has quit [Read error: Connection reset by peer]
jonatack has joined #commonlisp
kopiyka_ has quit [Remote host closed the connection]
kopiyka has joined #commonlisp
pve has joined #commonlisp
chomwitt has joined #commonlisp
chomwitt has quit [Ping timeout: 260 seconds]
habamax has joined #commonlisp
mdaadoun has joined #commonlisp
rgherdt has joined #commonlisp
phantomics has joined #commonlisp
zxcvz has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
dino_tutter has joined #commonlisp
seok has quit [Quit: Client closed]
mgl has quit [Ping timeout: 255 seconds]
anticrisis has quit [Read error: Connection reset by peer]
Gleefre has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
random-nick has joined #commonlisp
amb007 has quit [Ping timeout: 255 seconds]
chomwitt has joined #commonlisp
amb007 has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
<mfiano> If there is anyone experienced enough with the CFFI system, can you explain to me if it is possible and give me a nudge in the right direction, on how to define type translators when the foreign type is a C union struct (wrapped with cffi:defcunion)? I feel pretty lost here trying to figure out the correct pieces I need here, not even being close to a C programmer either.
<mfiano> And of course, I have most of what I need working with type translators for a lispy wrapper, but the last 10% requires me to do something about a union.
pranavats has joined #commonlisp
waleee has joined #commonlisp
chimp_ has joined #commonlisp
tibfulv has quit [Remote host closed the connection]
Psybur has quit [Ping timeout: 248 seconds]
tibfulv has joined #commonlisp
lottaquestions_ has quit [Quit: Konversation terminated!]
lottaquestions_ has joined #commonlisp
lottaquestions_ has quit [Quit: Konversation terminated!]
lottaquestions_ has joined #commonlisp
rtypo has joined #commonlisp
amb007 has quit [Ping timeout: 255 seconds]
amb007 has joined #commonlisp
gooba_ has joined #commonlisp
gooba has quit [Ping timeout: 258 seconds]
amb007 has quit [Ping timeout: 252 seconds]
amb007 has joined #commonlisp
lottaquestions_ has quit [Quit: Konversation terminated!]
lottaquestions_ has joined #commonlisp
tyson2 has joined #commonlisp
pfdietz has joined #commonlisp
Gleefre has joined #commonlisp
habamax has quit [Remote host closed the connection]
mdaadoun has quit [Remote host closed the connection]
alphacen1 has quit [Quit: WeeChat 4.0.5]
yitzi has joined #commonlisp
alphacentauri has joined #commonlisp
mdaadoun has joined #commonlisp
shka has quit [Ping timeout: 255 seconds]
rainthree has quit [Ping timeout: 255 seconds]
mdaadoun has quit [Remote host closed the connection]
NicknameJohn has quit [Ping timeout: 255 seconds]
NicknameJohn has joined #commonlisp
mdaadoun has joined #commonlisp
mdaadoun has quit [Remote host closed the connection]
mdaadoun has joined #commonlisp
mdaadoun_ has joined #commonlisp
mdaadoun_ has quit [Client Quit]
mdaadoun has quit [Remote host closed the connection]
mdaadoun has joined #commonlisp
mdaadoun has quit [Remote host closed the connection]
mdaadoun has joined #commonlisp
mdaadoun has quit [Remote host closed the connection]
mdaadoun has joined #commonlisp
McParen has joined #commonlisp
NicknameJohn has quit [Ping timeout: 255 seconds]
NicknameJohn has joined #commonlisp
jon_atack has joined #commonlisp
jonatack has quit [Read error: Connection reset by peer]
kevingal has joined #commonlisp
alphacentauri has quit [Quit: WeeChat 4.0.5]
Inline has quit [Quit: Leaving]
Inline has joined #commonlisp
rainthree has joined #commonlisp
McParen has quit [Ping timeout: 255 seconds]
azimut has joined #commonlisp
jello_pudding has quit [Ping timeout: 264 seconds]
<mfiano> Regarding the environment object bound with #'MAKE-LOAD-FORM, when exactly would you not want to use it and declare it ignorable in the implementation of reconstructing an equivalent instance? I am already fairly confused about when to use environment objects, and the examples given in CLHS all pretty much (declare (ignore ...)) it.
kevingal has quit [Ping timeout: 258 seconds]
waleee has quit [Ping timeout: 260 seconds]
tyson2 has quit [Read error: Connection reset by peer]
contrapunctus has left #commonlisp [#commonlisp]
jello_pudding has joined #commonlisp
<gilberth> mfiano: You should pass it along when you yourself make any call to e.g. CONSTANTP, MACROEXPAND, or MAKE-LOAD-FORM. Or any of the other functions that accept an environment argument.
<mfiano> Yes I see now. And it is almost always incorrect not to pass it along to *-SAVING-SLOTS from the context of *
<mfiano> Thanks.
<mfiano> Such nice flexibility I have here (I usually only need to call MAKE-LOAD-SAVING-SLOTS, so never thought much about it before)
<gilberth> You figured it out. Anyhow, a macro that is available with that environment may not be available when you pass NIL to e.g. MACROEXPAND.
contrapunctus has joined #commonlisp
<gilberth> So it's about whether you talk about a form being compiled or a form in whatever is already loaded into your runtime. Lisp implementations differ in how strict they are. But e.g. just compiling a DEFMACRO may not actually make that macro available in the runtime environment. This also applies to things like classes and therefore FIND-CLASS also has an environment argument.
<mfiano> Yes, and I imagine that most Common Lisp software in the wild is not correct here.
cage has joined #commonlisp
<mfiano> I usually develop on SBCL, but I run my tests on CCL, due to the default safety level and strictness requirements regarding load forms, altering the precedence chain of call-next-method, etc.
<gilberth> CCL has a stronger separation of compile-time and run-time environment than SBCL has.
<mfiano> I value that I can write code that works on both, which gives me a little more confidence than developing for the Rust version of the week.
<gilberth> It's always good to test with another Lisp implementation once in a while. And to me it's the reverse as I use CCL but would once in a while test with SBCL.
<mfiano> But my experience with other implementations is quite limited.
<gilberth> And then I have code like my CLEX scanner generator and RE engine, which I regularly test with CCL, SBCL, ECL, CLISP, and ABCL. That should about cover it.
<mfiano> It's always good to make sure code you care about is correct not only in results, but for longevity sake.
<gilberth> Indeed. I value that longevity. I still use code I wrote some 30 years ago.
<mfiano> Testing on another implementation may prevent a bug that occurs when your single implementation changes semantics.
<gilberth> Yes, and there are actually corners of the spec that allow for different behavior or even different interpretations. Or you accidently used undefined behavior all the time without noticing.
<beach> That's the understatement of the year.
<mfiano> :)
<beach> The standard is absolutely full of holes, and we are lucky that most implementations don't exploit very many of them.
<beach> Hence WSCL.
<semz> There's definitely a cultural difference regarding interpretation of UB in CL vs e.g. C, but I can't really figure out where it comes from.
Inline has quit [Remote host closed the connection]
<beach> Yeah, I find that observation very interesting.
<mfiano> I have heard the C hive mind say they use UB as a this sharp tool to address both bug prevention and performance. I still don't quite understand that.
<mfiano> But I don't try to understand C most of the time.
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<mfiano> To me that sounds like the philosophy of C is that of the polar opposite to Common Lisp, in that this specific mantra in use _relies_ on the specific compiler and version to work out bugs, fragmenting their community in a different way.
dino_tutter has quit [Ping timeout: 272 seconds]
<mfiano> So, are C programmers a lot of the time working around compiler bugs fruitlessly for a good portion of their programming time?
<mfiano> Sorry, I've veered to the dark side of offtopicness
rainthree has quit [Read error: Connection reset by peer]
<jcowan> mfiano: No, that's not how it works: miscompiling in the presence of UB is not a compiler bug, because UB makes your program 100% meaningless and licenses your compiler to do anything. Because the line between correct C and UB is so hard to understand, C programmers are compelled to use linters (both static and dynamic) that do indeed flush out a great many user-lvel bugs that don't involve UB.
jrx has joined #commonlisp
Inline has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
mdaadoun has quit [Remote host closed the connection]
contrapunctus has joined #commonlisp
<mfiano> Ok I need some clarification of
<mfiano> ::clhs load-time-value
<ixelp> CLHS: Special Operator LOAD-TIME-VALUE
<mfiano> Particularly: "This can happen both when an expression being evaluated or compiled shares substructure, and when the same form is processed by eval or compile multiple times."
<mfiano> My use-case is (load-time-value (make-instance 'foo ...)) within a function definition that is #'COMPILE-FILE
<mfiano> 'd
<mfiano> I am not passing READ-ONLY-P to LOAD-TIME-VALUE with the intention that the since instance will be mutated through the program's lifetime.
<mfiano> I do not want #'make-instance to be evaluated more than once throughout my program's lifetime. What do I do?
<mfiano> s/since/single/
mdaadoun has joined #commonlisp
attila_lendvai has quit [Ping timeout: 272 seconds]
asarch has joined #commonlisp
<beach> I don't think you need to do anything particular.
<mfiano> I don't think there is a concern for this case, but I'm trying to understand under what circumstances COMPILE may be invoked for a function definition multiple times, without explicitly doing so, because it says such instances should not be mutated. Compiler macros maybe?
<beach> But you need to avoid things like (... #1=(load-time-value ...) ... #1#...)
mdaadoun has quit [Remote host closed the connection]
NicknameJohn has quit [Ping timeout: 255 seconds]
azimut has quit [Ping timeout: 252 seconds]
jjnkn has joined #commonlisp
<bike> mfiano: if this is code being compile-file-d, compile isn't being invoked at all (for this purpose) let alone more than once. so you don't need to worry about it.
<bike> what the standard is talking about is basically just actually doing (eval form) (eval form) or (compile nil lexpr) (compile nil lexpr)
<bike> the make-instance will almost certainly be evaluated more than once if you repeatedly compile-file the file, however
NicknameJohn has joined #commonlisp
<bike> and load-time-value processing is part of the minimal compilation guarantee (3.2.2.2) so once it's compile-d it'll stay that way unless you explicitly compile again
NicknameJohn has quit [Ping timeout: 255 seconds]
NicknameJohn has joined #commonlisp
<jjnkn> hello, how would one use defstruct with a custom reader function for a slot while satisfying the compiler?
<jjnkn> here is an example: https://plaster.tymoon.eu/view/3972#3972
<jjnkn> i'm using SBCL
<jjnkn> i could switch to DEFCLASS but the property of conveniently comparing structures with EQUALP is too convenient
<bike> name the custom reader something else
<bike> like give the defstruct a conc-name of "%POINT-", then the built in reader is %POINT-X, and you can define POINT-X to do whatever
rogersm has quit [Read error: Connection reset by peer]
<jjnkn> that's a possible solution but i don't want to mess with names
rogersm has joined #commonlisp
<jjnkn> also, is there a standard facility for implementing equality tests for class instances?
<bike> there is not
<jjnkn> that's too bad
<bike> and messing with names is kind of what you're doing. defstruct is going to define the function it does and you can't change what function it generates.
jrx has quit [Remote host closed the connection]
<jjnkn> well, i guess i will just have to change the name to something else
amb007 has quit [Ping timeout: 258 seconds]
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 248 seconds]
<jjnkn> i cannot access (waiting timeout) https://common-lisp.dev, although the host responds to ICMP
jon_atack has quit [Read error: Connection reset by peer]
jonatack has joined #commonlisp
amb007 has joined #commonlisp
jeosol has quit [Quit: Client closed]
azimut has joined #commonlisp
<flip214> Shinmera: too bad that FOR:REPEAT is incompatible with LOOP's BELOW as it starts with 1 instead of 0.
waleee has joined #commonlisp
<jcowan> jjnkn: However, you can implement your own equality predicates. For example, you can write (DEFGENERIC SAME-AS (X Y) (:METHOD ((X T) (Y T)) (EQUAL X Y)))
<jcowan> (not tested) and then you can define methods for SAVE-AS that provide class-specific equality. It will fall back to EQUAL if no definition is given for a class.
makomo has quit [Quit: WeeChat 4.0.4]
<jjnkn> jcowan: something along those lines was in my plan of last resort
<jcowan> There is no reason not to. EQUAL and EQUALP are just particular equality predicates that you can use if you find useful or use your own instead. Unlike EQL and EQ, they have no magic to them.
alex1984 has joined #commonlisp
akoana has joined #commonlisp
<bike> there is a little bit of magic, in that unless your implementation has an extension for it, your custom equality predicate can't be used as a hash table comparator
<bike> i think that's it though
pfdietz has quit [Quit: Client closed]
mdaadoun has joined #commonlisp
mgl has joined #commonlisp
rogersm has quit [Quit: Leaving...]
attila_lendvai has joined #commonlisp
dino_tutter has joined #commonlisp
mdaadoun has quit [Remote host closed the connection]
<mfiano> bike: thanks for that
<beach> mfiano: The only problem with a custom equality predicate on instances of standard classes.
<mfiano> beach: I think that was meant for someone else.
<beach> Yes, for jjnkn and/or jcowan.
<mfiano> I just got back and didn't read the latest equality backlog. I'm still on the response to l-t-v
McParen has joined #commonlisp
<jcowan> bike: true, although you could write your own hash table implementation (or adapt Scheme's); again, is EQ and EQL hash tables that are magic
Gleefre has quit [Remote host closed the connection]
seok has joined #commonlisp
alphacentauri has joined #commonlisp
amb007 has quit [Ping timeout: 260 seconds]
asarch has quit [Quit: Leaving]
shka has joined #commonlisp
attila_lendvai has quit [Ping timeout: 258 seconds]
amb007 has joined #commonlisp
dtman34 has quit [Ping timeout: 264 seconds]
attila_lendvai has joined #commonlisp
amb007 has quit [Ping timeout: 260 seconds]
anticrisis has joined #commonlisp
amb007 has joined #commonlisp
makomo has joined #commonlisp
jjnkn has quit [Quit: leaving]
yitzi has quit [Remote host closed the connection]
McParen has quit [Ping timeout: 255 seconds]
random-jellyfish has joined #commonlisp
pve has quit [Quit: leaving]
azimut has quit [Ping timeout: 252 seconds]
zxcvz has quit [Quit: zxcvz]
attila_lendvai has quit [Ping timeout: 248 seconds]
attila_lendvai has joined #commonlisp
Pixel_Outlaw has joined #commonlisp
alex1984 has quit [Quit: Leaving]
pequod has joined #commonlisp
azimut has joined #commonlisp
<random-jellyfish> I wrote a sketch of a coroutine library that uses tagbody behind the scenes, I call the coroutines tasks, here's an example
<ixelp> ;; A coroutine that can be called multiple times and resumed from where it stopp - Pastebin.com
<random-jellyfish> would this be useful to anyone?
<random-jellyfish> not sure if I should wrap it up as a package and publish it or just use it myself
<seok> is infinite loop checking a condition to poll for an event computationally expensive?
<random-jellyfish> seok do you do other things in that loop besides checking the condition?
<seok> it's an event poller so I guess not?
<seok> only when the condition is met
<random-jellyfish> if you do it in its own thread I don't see why it would slow down things
<seok> if I have a hundred such threads does it block anything?
<random-jellyfish> did you run any benchmarks?
<seok> nop
<seok> I'm not sure if this is the typical way to implement event polling
<random-jellyfish> the more threads you run the slower it will get, but up to some threshold you should not see a difference
<random-jellyfish> try to increase the nr of threads and measure the time
attila_lendvai has quit [Ping timeout: 260 seconds]
zxcvz has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 29.1]
shka has quit [Ping timeout: 255 seconds]
zxcvz has quit [Quit: zxcvz]
pequod has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<bike> seok: well you'll burn cycles doing the polling, but that's kind of how polling goes, no? if you want something more efficient you'd want more like condition variables, ie not polling
<Mondenkind> I assumed they meant poll in the sense of poll(2). But perhaps not
rgherdt has quit [Quit: Leaving]
amb007 has quit [Ping timeout: 260 seconds]
habamax has joined #commonlisp
dino_tutter has quit [Ping timeout: 258 seconds]
<bike> well, they said infinite loop
<Mondenkind> (loop (dispatch (poll))) doesn't seem to be in conflict
NicknameJohn has quit [Ping timeout: 248 seconds]
tyson2 has joined #commonlisp
iska` has joined #commonlisp
iska has quit [Ping timeout: 255 seconds]
<gilberth> Only because poll(2) is poorly named. To every other person polling is asking about whether something of interest happened without waiting for that thing to happen.
amb007 has joined #commonlisp
NicknameJohn has joined #commonlisp
amb007 has quit [Ping timeout: 272 seconds]
dtman34 has joined #commonlisp
chimp_ has quit [Read error: Connection reset by peer]
<Mondenkind> sure, but that poll(2) is quite mainstream. And there is epoll too, named after it
<Shinmera> flip214: ? you can just use ranging.
chomwitt has quit [Ping timeout: 255 seconds]
overclucker has quit [Read error: Connection reset by peer]
overclucker has joined #commonlisp
amb007 has joined #commonlisp
random-nick has quit [Ping timeout: 272 seconds]