Xach 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>
nij- has left #commonlisp [#commonlisp]
miique has joined #commonlisp
wyrd has quit [Quit: Lost terminal]
wyrd has joined #commonlisp
NotThatRPG has quit [Read error: Connection reset by peer]
s-liao has joined #commonlisp
jstoddard has quit [Quit: ERC (IRC client for Emacs 27.2)]
monaaraj has quit [Ping timeout: 256 seconds]
sloanr has quit [Remote host closed the connection]
monaaraj has joined #commonlisp
sloanr has joined #commonlisp
cosimone has joined #commonlisp
lisp123 has joined #commonlisp
taiju has quit [Remote host closed the connection]
lisp123 has quit [Ping timeout: 256 seconds]
taiju has joined #commonlisp
wyrd_ has joined #commonlisp
wyrd has quit [Ping timeout: 276 seconds]
wyrd_ has quit [Client Quit]
wyrd has joined #commonlisp
z3t0 has joined #commonlisp
monaaraj has quit [Ping timeout: 240 seconds]
monaaraj has joined #commonlisp
Demosthe1ex has joined #commonlisp
Demosthenex has quit [Ping timeout: 256 seconds]
Oladon has joined #commonlisp
igemnace has joined #commonlisp
IPmonger has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
sloanr has quit [Ping timeout: 240 seconds]
s-liao has quit [Ping timeout: 256 seconds]
Danishman has quit [Quit: Leaving]
s-liao has joined #commonlisp
lisp123 has joined #commonlisp
jstoddard has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
thomaslewis has left #commonlisp [#commonlisp]
s-liao has joined #commonlisp
<fe[nl]ix> luis: I fixed all references to Launchpad in the sources
taiju has quit [Ping timeout: 240 seconds]
<CodeBitCookie[m]> Hello Everyone!
<CodeBitCookie[m]> What would be the best alternative for stb_image.h? Asking because I am making an application with CL-OPENGL.
<CodeBitCookie[m]> ... And want to load a texture.
<CodeBitCookie[m]> s/...//
<CodeBitCookie[m]> s/.//, s/.../and/, s/And//
<CodeBitCookie[m]> Hello Everyone!
<CodeBitCookie[m]> What would be the best alternative for stb_image.h? Asking because I am making an application with CL-OPENGL and want to load a texture.
<beach> Asking once is enough.
<CodeBitCookie[m]> beach: Someone said my message was not sent...
<lisp123> Ah sorry CodeBitCookie[m], I didn't see the first version, my mistake
<beach> I see.
<CodeBitCookie[m]> lisp123: np
waleee has quit [Ping timeout: 240 seconds]
<beach> Good morning everyone!
<CodeBitCookie[m]> beach: Good morning.
<beach> I am still puzzled by questions such as "is there something similar to <mumble> in Common Lisp", where <mumble> is some feature of some other language that it is absolutely not clear that #commonlisp participants ought to know.
<beach> So people asking such questions either incorrectly assume that most people know <mumble> or they voluntarily restrict themselves to answers from people who do know. It seems to me a better solution to describe the desired functionality, because then more people are likely to know the answer.
thomaslewis has joined #commonlisp
<CodeBitCookie[m]> Oh sorry beach. My mistake
<CodeBitCookie[m]> I want a simple image loading library like "zpng" or "cl-jpeg" but with most popular formats.
<beach> Well, you do what you want, but I for one have absolutely no idea what stb_image.h, but it looks like a C include file.
<CodeBitCookie[m]> beach: Its a simple header file which loads an image in most popular formats. It is very popular for anyone who has tried to load a texture in OpenGL.
IPmonger has joined #commonlisp
qhong- has quit [Quit: ZNC 1.7.4 - https://znc.in]
qhong has joined #commonlisp
<CodeBitCookie[m]> beach: Is that question good enough?
<CodeBitCookie[m]> CodeBitCookie[m]: this one ^
<beach> Looks that way.
IPmonger has quit [Remote host closed the connection]
<beach> Do you know about the library opticl? As I recall, it has code for loading images in various formats.
<CodeBitCookie[m]> I was JUST reading about it right now.
<CodeBitCookie[m]> Looks alright, just seeing how to load an image.
semz has quit [Ping timeout: 268 seconds]
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
semz has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
lisp123 has quit [Quit: Leaving...]
<jmercouris> Trying to think of a simple way to do: (list 1 3 5) (list 2 4 6) to combine into (list 1 2 3 4 5 6)
<Bike> (loop for a in lista for b in listb collect a collect b)
<Bike> gets weird if they have different lengths, though
<jmercouris> Bike: indeed, that is a good way
<jmercouris> I was hoping for alexandria, but loop is just as good, very obvious too
z3t0 has quit [Read error: Connection reset by peer]
<jmercouris> thanks
<Bike> no problem
<Bike> maybe alexandria has some kind of interleave, lemme see
<jmercouris> I'm kind of confused about something
<jmercouris> not sure I should do (intern "xyz" (find-package 'keyword))
<jmercouris> or if I should do (make-symbol "keyword")
<jmercouris> I understand /some/ of the differences between them, but not all of the nuances
<Bike> what are you doing with it?
<jmercouris> I'm doing (make-instance 'xyz :some-init-arg "some-value")
<Bike> well, the main difference is that with make-symbol, the resulting symbol won't be interned. so, for example, it can be garbage collected
<jmercouris> yes, that is the key difference I know
<Bike> and it can't be accessed through find-symbol
<jmercouris> I was was wondering if that may present problems to the machinery of clos
<Bike> you're doing like (make-instance (make-symbol "xyz") ...)?
<jmercouris> Bike: yes
<jmercouris> sorry, it would actually be (make-instance 'xyz (make-symbol ":qwe") "some-value")
<Bike> oh the init keyword
<jmercouris> where :qwe is the :initarg of some slot
<Bike> yeah, no, that's fine
<jmercouris> OK, good to konw
<jmercouris> s/konw/know
<Bike> of course it means you have to use that same symbol later
<jmercouris> it just felt off to me for some reason
<beach> Bike: Are you sure?
<Bike> another (make-symbol "qwe") will not be the same symbol
<Bike> beach: i don't see why it would be a problem? i've used non-keyword initargs in admittedly exotic code and it was fine
<beach> (make-symbol ":qwe") would work if :qwe is an initarg?
<Bike> oh, no, of course not. i didn't think that was what jmercouris meant.
<jmercouris> ah I see what beach is saying now
<Bike> i'm imagining a scenario where there are class definitions generated by a macro.
<jmercouris> no, Bike understood me, and I misspoke
<jmercouris> Bike: close, I can post the snippet for your amusement in a second
<jmercouris> I'm sure there is a lot to improve, but it is a first draft
<Bike> jmercouris: oh, i forgot for the list thing you can use merge: (merge 'list (list 1 3 5) (list 2 4 6) #'<) => (1 2 3 4 5 6). that sorts, so maybe it's not what you want though
<jmercouris> I don't want it to be sorted, I already thought about that
<Bike> ah k
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
akoana_ has quit [Quit: leaving]
akoana has quit [Quit: leaving]
jealousmonk has quit [Quit: ERC (IRC client for Emacs 27.1)]
<jmercouris> Bike, beach, in case you are curious: http://dpaste.com/AVRSYTQ9S
<jmercouris> feels very wrong with the eval in there...
<Bike> (apply #'make-instance 'process instance-arguments)
<jmercouris> hm, indeed
<jmercouris> yes, that is much better
<jmercouris> I was stuck thinking in macro mode
<jmercouris> this is why I like this channel, it helps me break out of my thought bubbles
<jmercouris> I always forget about funcall and apply for some reason
<jmercouris> Bike: do you agree with the general approach?
<jmercouris> as per why I chose to use symbols rather than strings when invoking process-list, is because I don't know what the state of the reader will be, whether it will have upcased things or not
<Bike> hm, i think i'd go the other way and have format-controls be a list of keywords
<Bike> then for the ps command print the symbol names and downcase them or whatever
<jmercouris> that also works
<jmercouris> yes, I will try some experiments
<jmercouris> that is clearer, thank you for the suggestion
<Bike> i think the format string you already have should handle downcasing and everything fine actually
<jmercouris> it does
<Bike> i never remember how ~(~) work
<jmercouris> it just downcases all format output within the region
<jmercouris> from PCL: The last directive for dealing with emitting English text is ~(, which allows you to control the case of text in the output. Each ~( is paired with a ~), and all the output generated by the portion of the control string between the two markers will be converted to all lowercase.
<Bike> yeah but the options and whether it's downcase or upcase and egh
<Bike> anyway
Bike has quit [Quit: sleepin]
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
jstoddard has quit [Remote host closed the connection]
jstoddard has joined #commonlisp
Jing has joined #commonlisp
Alfr has quit [Remote host closed the connection]
Alfr has joined #commonlisp
aartaka has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
jstoddard has quit [Ping timeout: 240 seconds]
myrrh has joined #commonlisp
miique has quit [Read error: Connection reset by peer]
miique has joined #commonlisp
taiju has joined #commonlisp
taiju has quit [Client Quit]
Oladon has quit [Quit: Leaving.]
aartaka has quit [Ping timeout: 240 seconds]
aartaka has joined #commonlisp
attila_lendvai has joined #commonlisp
varjag has joined #commonlisp
iamFIREcracker has joined #commonlisp
<jdz> jmercouris: (mapcan #'list '(1 2 3) '(4 5 6))
<jackdaniel> (map nil fn …) should be (mapcant fn …)
mgl has joined #commonlisp
gaqwas has joined #commonlisp
<contrapunctus> I tried to make a snippet for `ql:quickload` - https://paste.rs/eca , meant to be run in `slime-repl-mode` , but when I expand it, I get this error - https://paste.rs/gF0
OlCe has quit [Ping timeout: 256 seconds]
nij- has joined #commonlisp
taiju has joined #commonlisp
pve has joined #commonlisp
rotateq has joined #commonlisp
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
OlCe` has joined #commonlisp
beach has quit [Read error: Connection reset by peer]
beach has joined #commonlisp
hhdave has quit [Quit: hhdave]
monaaraj has quit [Ping timeout: 256 seconds]
attila_lendvai has quit [Quit: Leaving]
attila_lendvai has joined #commonlisp
vegai has joined #commonlisp
jeosol has quit [Ping timeout: 256 seconds]
gaqwas has quit [Ping timeout: 240 seconds]
attila_lendvai has quit [Quit: Leaving]
monaaraj has joined #commonlisp
attila_lendvai has joined #commonlisp
monaaraj has quit [Ping timeout: 240 seconds]
monaaraj has joined #commonlisp
joast has quit [Ping timeout: 240 seconds]
<phoe> when I woke up today, I realized that I-I, I-I, U-I-F-D-C and U-I-F-R-C are The Four Horsemen of SHARED-INITIALIZE
<beach> What's the difference between the first two?
<phoe> s/I-I/R-I/
<beach> Ah.
* phoe needs to wake up
<beach> Try coffee.
<jackdaniel> the first goes I-I and the second goes I-I with a higher pitch
lisp123 has joined #commonlisp
OlCe` has quit []
OlCe has joined #commonlisp
* phoe tries yerba mate, succeeds
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<contrapunctus> Is there anything like Elisp's `edebug` in Common Lisp? `step` is close, but not quite the same...
<beach> [here we go again] I don't know what `edebug' does, but you might want to check http://metamodular.com/SICL/sicl-debugging.pdf for a description of the dismal debugging situation for FLOSS Common Lisp implementations.
Everything has joined #commonlisp
<OlCe> Hi,
<phoe> hey hi
<OlCe> contrapunctus: You probably mean BREAK, not STEP (as a function to call).
<OlCe> contrapunctus: I'm not familiar with edebug.
<rotateq> as long as no one claims elisp has a superior condition system :)
<OlCe> But if you use (DECLAIM (OPTIMIZE (DEBUG 3))) before compiling your code,
<OlCe> you then are able to do lots of things in the debugger.
<jackdaniel> proclaim
<jackdaniel> declaim may apply only to the file it is put in
<OlCe> For SBCL, you have to make sure that other metrics are not too high too.
<jackdaniel> (not necessarily though - it may apply to the global environment - that's undefined)
<OlCe> jackdaniel: Yes. But I was thinking of typing that at the REPL.
<OlCe> Since this is a debugging session anyway.
<jackdaniel> it may have no effect whatsoever then
monaaraj has quit [Ping timeout: 256 seconds]
<OlCe> jackdaniel: This is a global declaration, so it is supposed to.
<contrapunctus> beach, OlCe: edebug is an interactive source-level debugger. Basically like `step` , except the interaction happens in the source itself, not an sldb buffer.
<jackdaniel> OlCe: where declaim specificaiton says that it performs global declarations?
<OlCe> jackdaniel: CLHS 3.3
<contrapunctus> lisp123: thanks, I'll check that out.
monaaraj has joined #commonlisp
<jackdaniel> it is not what the specification of the operator declaim says
<jackdaniel> but I see where did you get it from
<OlCe> jackdaniel: The specification doesn't contradict this.
<OlCe> jackdaniel: But yes, it is quite terse, and assumes context.
<jackdaniel> that's why I've said that it is undefined
<OlCe> jackdaniel: Actually, it uses the word "proclamation" nonetheless (in the file compilation specific paragraph).
<OlCe> contrapunctus: Not sure if I understand what you mean by interaction with the source code.
<OlCe> contrapunctus: Are you, e.g., able to change the source after some stepping point?
<OlCe> contrapunctus: Or is the functionality the same as that of a debugger (like sldb), just presented differently?
<contrapunctus> OlCe: the latter.
<OlCe> contrapunctus: Ok, thanks. I'll try it (some day(TM)).
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
frgo has quit []
<beach> contrapunctus: Like I said, in FLOSS Common Lisp implementations, there is basically nothing like that.
<beach> s/said/wrote/
monaaraj has quit [Ping timeout: 240 seconds]
monaaraj has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 240 seconds]
Lord_of_Life has joined #commonlisp
<OlCe> contrapunctus: Thanks.
monaaraj has quit [Ping timeout: 256 seconds]
monaaraj has joined #commonlisp
varjag has quit [Ping timeout: 256 seconds]
<beach> contrapunctus: But perhaps you should start working on writing a debugger. I have started a bit: https://github.com/robert-strandh/Clordane
<ns12> Hello, in the list of Common Lisp implementations for FreeBSD on cliki (https://www.cliki.net/FreeBSD), there is "SBCL (without threading support)". Is this still accurate? What is the significance of having no threading support?
<OlCe> beach: There is SLY, a (more modest) step towards this.
<rotateq> ns12: ah then it is the situation like on ARM platforms
<phoe> ns12: no idea if it's still accurate
<OlCe> ns12: It is not. FreeBSD's ports has been having threads enabled by default for ages.
<ns12> OlCe: I see. The "SBCL (without threading support)" bit was added to the CLiki article in 2004.
<akater[m]> OlCe: If you're certain, feel free to edit CLiki, it is in need of attention.
<rotateq> heh.
<beach> OlCe: So SLY must be doing magic, because none of the FLOSS Common Lisp implementations is capable of the support that a debugger needs.
<beach> Actually, that's not quite true, but see the paper for details on the current situation.
<OlCe> ns12: Enable by default on Sep the 17th 2018. So, not exactly ages, but still more than 3 years.
<OlCe> akater[m]: Ok, I'll see to that.
theothornhill has quit [Remote host closed the connection]
<rotateq> ns12: or you go along with ecl or clisp too and look what fits your needs
* mfiano uses SBCL on FreeBSD with threads.
<ns12> Does the use of threads make a program non-portable, since threads are not specified in the Common Lisp standard?
<phoe> strictly speaking, yes
<phoe> in practice, just use bordeaux-threads
<phoe> strictly speaking, a portable program must not depend on a non-standard language extension
<jackdaniel> histerically speaking :) using threads can make the program not portable across operating systems
<phoe> in practice, threads are very common on implementations and platforms, and many people write their programs with the assumption that common compatibility libraries (e.g. bordeaux-threads for threading support) will run there
<jackdaniel> i.e for long time threading support was sub par on Windows; sbcl doesn't support threads on arm32 (I don't think that there are plans to implement that)
<jackdaniel> etc
<ns12> jackdaniel: "sbcl doesn't support threads on arm32" - Does this mean that bordeaux-threads cannot work on sbcl arm32?
<jackdaniel> it won't be able to spawn a concurrent thread on sbcl/arm32 (if that's what you mean by working)
<rotateq> i just realized it when i tried to load the april compiler on my pi with sbcl ^^
<phoe> bordeaux-threads is not a standalone implementation of threads, just a compatibility library that wraps threading support of the underlying implementation
<phoe> if the underlying Lisp has no threads, BT won't make them appear out of thin air
<jackdaniel> (pull them out of the hat!)
* phoe puts on his robe and wizard hat
<rotateq> "Broom, broom! You have been."
s-liao has quit [Ping timeout: 256 seconds]
lisp123 has quit [Remote host closed the connection]
random-nick has joined #commonlisp
<OlCe> akater[m]: Done. I've also updated the list of officially supported architectures (because, apart from x86, it was seriously outdated... and gone).
<OlCe> beach: Yes, I know the paper and read it a while back.
<OlCe> beach: There is a variable you can set to break into the debugger at each sticker.
<OlCe> beach: Not quite what edebug is doing, but a "step" to that.
<OlCe> beach: SLYNK-STICKERS:*BREAK-ON-STICKERS*
s-liao has joined #commonlisp
<akater[m]> OlCe: Thank you. I used to edit CLiki regularly but then it apparently became picky about logins so I've been estranged for some time.
lisp123 has joined #commonlisp
kevingal has joined #commonlisp
<mfiano> Stickers are incredibly useful, and pretty much the only thing that has been keeping me on SLY instead of SLIME for years.
amb007 has quit [Ping timeout: 240 seconds]
<lisp123> mfiano: What do stickers do?
amb007 has joined #commonlisp
<mfiano> visual buffer value capturing and alternative to print-debugging
<lisp123> Nice
<lisp123> Time to Sly
<phoe> What are the situations in which a slot can be unbound after UPDATE-INSTANCE-FOR-REDEFINED-CLASS is called for it? I can count three so far: 1) the slot was already bound, 2) there was an initarg provided for it, 3) there was no initarg provided but the slot has an initform.
<phoe> s/can be bound/will be bound/
<phoe> s/called for it/called for an instance/
<OlCe> mfiano: Yes, stickers are great. But personally, since I don't use them that much, I've mostly gone back to plain Slime.
<OlCe> mfiano: And also for the fact that Sly sometimes lags behind when the backend needs to be changed for new CL platform versions.
<OlCe> mfiano: But I'm still using SLY from time to time.
varjag has joined #commonlisp
<phoe> hmmmm
* phoe finds a MOP bug in JSON-MOP
<jackdaniel> [defclass "name" {a: 32, b: 42}] /* long live common json */
<lisp123> phoe: :O
<lisp123> That's breaking news, given the importance of the library. What was it?
<lisp123> Oh cool, will read
<phoe> I think that I am starting to understand the four horsemen
<lisp123> Oh JSON-MOP, not CLOSER-MOP :D I misread. Still must be very important
<jackdaniel> cool bug, would segfault
<ns12> phoe: "I think that I am starting to understand the four horsemen" - What does that mean?
<rotateq> i still find this COS project interesting for giving C a more CLOS like object system. or using ecl when it will come some day to such situation i need it
<Gnuxie> phoe: sorry i caused that bug by not doing it via shared-initialize
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<phoe> ns12: the ways in which the four standard functions that call SHARED-INITIALIZE
<phoe> ...the way in which they work and how they work
<beach> ... and when.
<phoe> that too
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
<rotateq> phoe: hm three of those abbreviations I recognize from memory, the one I-I would be initialize-instance, what's the other then? :)
<phoe> reinitialize-instance, update-instance-for-{redefined,different}-class
<rotateq> oh okay, i read a second I-I above, not R-I, sry
<phoe> oh, yes
<phoe> I fixed it afterwards
<rotateq> hehe
<phoe> should have been R-I
<rotateq> so upto now i just have used of those initialize-instance with :after and U-I-F-D-C
<beach> phoe: What is it that you are working on?
<phoe> beach: 1) broadening my MOP knowledge, 2) a class whose slots must be always bound, 3) a class whose slots have enforced types
<beach> Ah, so mainly "exercises"?
<phoe> I'll want to use this one in a project of mine later, so a bit more than exercises
<beach> Got it.
<phoe> what should happen if UPDATE-INSTANCE-FOR-REDEFINED-CLASS signals an error upon being called on an obsolete instance?
<phoe> a bit more specifically - U-I-F-R-C :BEFORE
attila_lendvai has quit [Quit: Leaving]
<phoe> should U-I-F-R-C be called again once this instance is accessed for the second time, since the first call did not get a chance to do anything?
<beach> There should be no way for an obsolete instance to reach a method.
<beach> It should be updated before it gets that far.
attila_lendvai has joined #commonlisp
<phoe> hmm, that's an answer
<phoe> so the process is more or less (progn (update-instance) (u-i-f-r-c ...))
<phoe> or so it seems
<beach> Let me check the definition...
<beach> clhs u-i-f-r-c
<phoe> so, if u-i-f-r-c signals an error and control leaves it, then there is no way for it to get called again on the same instance
<specbot> update-instance-for-redefined-class: http://www.lispworks.com/reference/HyperSpec/Body/f_upda_1.htm
<phoe> since the instance is now considered to be updated *even* if U-I-F-R-C did not finish updating it
<beach> So that means that the structure of the instance is up to date, but some slots may be wrong or uninitialized.
<phoe> yes
<phoe> and I'm running into this scenario right now
<phoe> the U-I-F-R-C method in line 18 is simplified
<phoe> but it shows that the second DEFCLASS FOO succeeds in adding the slot but fails at using its initform
<phoe> ...on SBCL at least, CCL gives me no error whatsoever
* phoe stares
attila_lendvai has quit [Quit: Leaving]
attila_lendvai has joined #commonlisp
<phoe> but okay then - let's suppose that U-I-F-R-C :BEFORE signals an error and the primary method does not manage to execute, like in this case
pranavats has left #commonlisp [Error from remote client]
<phoe> what's the way forward if we have a half-updated instance like that?
<beach> I don't see how that changes anything.
<beach> The structure of the instance will be correct, but some of its slots may have the wrong value.
<phoe> yes, and that's an erroneous situation - how can I "recover" that instance?
pranavats has joined #commonlisp
Everything has quit [Quit: leaving]
hhdave has joined #commonlisp
tyson2 has joined #commonlisp
<ns12> OlCe: Thank you for updating https://www.cliki.net/FreeBSD
<phoe> errors in I-I are not a problem because I can redo the whole call easily, I have all the arguments
<phoe> same with R-I
<phoe> in case of U-I-F-R-C, I could try to call it again myself, but I would need to remember its original arguments so I can re-do the whole call
<phoe> and I have not yet thought of the case of errors inside U-I-F-D-C
jeosol has joined #commonlisp
nature has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
cage has joined #commonlisp
monaaraj has quit [Ping timeout: 256 seconds]
waleee has joined #commonlisp
miique has quit [Read error: Connection reset by peer]
cranium has joined #commonlisp
miique has joined #commonlisp
foxfromabyss has joined #commonlisp
rain3 has joined #commonlisp
monaaraj has joined #commonlisp
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
<yitzi> Does anybody know of any org-mode parsers for CL besides cl-org-mode? I haven't evaluated the coverage of cl-org-mode yet. I am just making sure I know all of the alternatives before I jump into using it.
nij- has joined #commonlisp
<lisp123> yitzi: What do you need it for?
<yitzi> I am exploring writing CL extension specifications in org-mode for an idea we have been discussing in #sicl. Basically, a WSCLE (Well Specified Common Lisp Extensions).
<lisp123> And what would the org-mode parser do? I am asking because I wanted to see if the standard org-mode facilities are enough
monaaraj has quit [Ping timeout: 256 seconds]
<nij-> I know you ask for an org parser in CL but there's a good one written in Clojure, using an EBNF->parser library "instaparser".
<nij-> If I'm not mistaken, cl-org-parser doesn't use such kind of a library.
<yitzi> Parse the specification into an AST for scymtym's dpans-conversion code and probably extract source code for default implementations in the literate programming sense.
<yitzi> nij-: Yeah, Its got to be in CL. Thanks though!
<nij-> However, there's https://github.com/diasbruno/cl-bnf
<nij-> It doesn't seem to work with extended nor augmented BNF.
<lisp123> yitzi: Thanks for the color. Sorry I have nothing of value to add based on that
<nij-> It's good to have a cl-(a|e)bnf, and use what https://github.com/200ok-ch/org-parser does to implement a real org-mode parser in CL.
<yitzi> lisp123: No worries. Its all theoretical at this point.
monaaraj has joined #commonlisp
<nij-> (I'm actually not sure whether cl-bnf is enough for org syntax.)
<yitzi> No idea if bnf is enough and I'm not gonna write a parser unless I am forced to. ;)
<nij-> ;) ok my hope is lost
<nij-> What's your plan now then?
<yitzi> Try cl-org-mode eventually. Again, I am miles from that step. Just exploring the landscape. For the interim I'll probably write a spec for gray streams in org mode and then I'll get to org-mode parsing stage.
<lisp123> Hi all - I'm keen on any feedback on the following. I was thinking of a way to combine classes (multiple inheritance) in a way that allows for generic functions to specialise on slots
<nij-> Btw yitzi there seems to be two different cl-org-mode: https://github.com/deepfire/cl-org-mode https://common-lisp.net/project/cl-org-mode/
<lisp123> yitzi: What about a pure CL solution? I.e. create a mini documentation system
<nij-> The second one is well-documented but I cannot find the code.
<nij-> The first one has the code but doesn't seem easy to use.
<yitzi> lisp123: I am sure it may be that eventually, but I have to hook into the existing stuff they are working on in CLIM (which is a spec browser of sorts).
<lisp123> yitzi: Ah okay, understood
nij- has quit [Quit: Using Circe, the loveliest of all IRC clients]
pranavats has left #commonlisp [Error from remote client]
pranavats has joined #commonlisp
s-liao has quit [Quit: Client closed]
<cage> local-nicknames are great! Thanks to all the people that implemented this feature!
<rotateq> lisp123: i think about your line 172 if it would macro-expand correctly
<rotateq> and maybe better when you do ATOM in a typecase branch then not LIST but CONS in the other
<rotateq> yes it is cage
<lisp123> rotateq: I hacked that in (I tested it without non-inherited-slots), but will fix that later if necessary (at least the general idea can be taken)
<lisp123> let me rename list to cons :-)
<rotateq> colored-shape-shape :D
<rotateq> yes I just have this in mind "everything that's not a CONS is an ATOM" ^^
<lisp123> rotateq: It's a better way for sure, thanks for pointing out. Since the definition of ATOM is (not cons)
<rotateq> yes but with the macro in the end, did you do some expand?
<lisp123> it seems to work
<lisp123> I just haven't tested with non-inherited-slots yet
<rotateq> hmm I just wasn't sure with the list thing in line 172
<lisp123> there's a typo, non-inherited-slots should be ,non-inherited-slots
<lisp123> but otherwise okay: https://plaster.tymoon.eu/view/2841#2841
<pjb> lisp123: you cannot dispatch on slots, but you can dispatch on mixin classes.
<lisp123> pjb: So the point here is to store an instance of the mixin class (even though in normal usage they are not meant to be instantiated) in the slot, so that then you can dispatch on the slot
<pjb> lisp123: you seem to be saying something different now. You're talking now about the slot value. Before you only talked about the slots.
<contrapunctus> In this program I'm working on, `a.lisp` contains `a:my-class` and generic function `make-foo` ; `b.lisp` contains `b:my-class` and method `make-foo` specializing on `b:my-class` . But when I call `make-foo` in `a.lisp` I get a 'no applicable method' error. The object it is called with is an instance of `b:my-class` ...so what gives? 🤔️
<Xach> contrapunctus: does make-foo refer to the same symbol in each file?
<lisp123> pjb: Sorry, so what I meant was to overcome the inability to specialise on slot, I am suggesting storing an instance of the mixin class in the slot so that when you pass the slot value to a generic function, you can specialise on it (since it is now a class object vs. a value)
<pjb> lisp123: otherwise it's just a matter of calling th egeneric function on the slot value: (defclass point () ((x :initarg :x :reader x))) (defmethod move ((pt point)) (move (x pt))) (move (make-instance 'point :x (make-instance '<body> :body 'bod))) #| moving body --> nil |#
<pjb> lisp123: an instance of a class, be it a mixin class, is an instance, not a class, unless that class was a meta class.
<pjb> classes are first class objects in lisp, so class objects are values.
<rotateq> ah okay lisp123, now i got it, was just unfamiliar use in a backquoted expression
<lisp123> pjb: Thanks. So that code makes sense. Now what if you want to subclass <leg> into <right-leg>
<lisp123> You would need to create <animal-with-right-leg> or something similar, correct?
<pjb> Then you just do that, and (defclass bipedal-animal (animal <right-leg>) ())
<pjb> Yes.
<pjb> Again do you want to dispatch on the slots, or on the values bound to the slots?
<lisp123> But if there's many combinations (e.g. 10 shapes x 15 colors = 150), it becomes a lot
<pjb> there are method combinations.
<pjb> what method combination do you want?
<pjb> lisp123: what is the last name of a last name?
<rotateq> lisp123: so you can learn writing macros that generate macros maybe
<pjb> I've not given a first name to my first name. Perhaps I should. "Pascal" I name thee "Bob"!
<pjb> Now (first-name #<pjb>) -> "Bob"…
<pjb> What use is that?
<contrapunctus> Xach: I think so. It's always used without package prefixes...
<lisp123> pjb: My terminology is bad, so rather than saying it the wrong way, let me give an example: (make-instance 'animal :leg (make-instance '<right-leg> :leg "leg") ...)
<pjb> lisp123: instead of talking about classes, slots, values, etc, you should be talking about your problem domain!
<phoe> contrapunctus: that's a code smell
<pjb> lisp123: what are those colors and those shapes?
<phoe> DEFMETHOD is kinda infamous for silently implicitly creating generic functions
<phoe> so DEFMETHOD FOO and DEFMETHOD FOO in two different packages can silently define methods on two different GFs
<contrapunctus> phoe: so do I write `(defmethod a:make-foo ...)` ?
<lisp123> If you do that, then you can do (defmethod new-move ((obj animal) (obj right-leg)) ...) and then called with (new-move animal (leg animal))
<phoe> contrapunctus: either that or you IMPORT-FROM the symbol
<phoe> or rather, IMPORT the symbol, or use :IMPORT-FROM in your package definition
<contrapunctus> Ah, that seems to have changed the error, at least xD
<contrapunctus> thanks phoe and Xach
<pjb> lisp123: yes, this is my point example above. you don't need the mixins, just have your method call methods that dispatch on the slot values.
<lisp123> pjb: Thanks, will think a bit and re-read the above
<pjb> lisp123: again, it would be better if you explained first what you want to do.
<pjb> Not how.
<cage> rotateq: :)
tyson2 has quit [Remote host closed the connection]
<lisp123> pjb: I am writing a parser with a large set of rules (well not that large, but lets assume it can get large) on how to parse. Initially, I had a large COND table that went through each parser rule and applied it. Now I'm rewriting in a CLOS way where each of those conditional paths becomes its own DEFMETHOD, specialising on parts of the object it receives
<lisp123> For example, I read a word say "Thus," and I split it into components - the word "thus" and trailing-punctuation ",". For some types of words, trailing punctuation matters, for others it does not
<frodef> I haven't really figured out pathnames.. if I have a directory foo (e.g. #p"/tmp/") how am I suppod to get the pathname for the file "bar.zap" in that directory? (so ending up with #p"/tmp/bar.zap")
Bike has joined #commonlisp
<pjb> lisp123: Perhaps something similar to what I did to parse lambda-lists: https://github.com/informatimago/lisp/blob/master/common-lisp/lisp-sexp/source-form.lisp#L495 ?
foxfromabyss has quit [Quit: Client closed]
nature has quit [Ping timeout: 240 seconds]
<lisp123> pjb: Thanks, will have a read
<pjb> lisp123: but otherwise, the question when you perform an OO analyse, is to determine what concepts need to be reified, ie. made into objects/classes.
<lisp123> pjb: It's a hard topic :(
domovod has joined #commonlisp
<pjb> lisp123: when you have a cond, you have a mapping from conditions to expressions. If you consider that each mapping is a rule, and reify rules, this means that you preview that there may be a dynamic set of rules. If all the rules are fixed and known at code writing time, then writing the cond may be better.
<bollu> I'm trying to move to emacs+slime. When I run `slime-eval-buffer`, I get an error at (EVAL (ASSERT-EQUAL (DEEPEQ (MK-INST-ADD :X :Y 1) (MK-INST-ADD :X :Y 1)) T)), where the (ASSERT-EQUAL ...) comes from my source code
<bollu> How do I move to the appropriate source location
<lisp123> pjb: "known at code writing time..." -> Yes, I was getting to the same conclusion as well as I did it more
<bollu> or, am I supposed to run my LISP file with some other interface?
<bollu> I'm using emacs+slime+sbcl for the record. I don't know if that affects things.
<pjb> lisp123: so if you reify the rule; (defclass rule () ((condition :initarg condition-predicate :reader condition-predicate) (parser :initarg :parser-function :reader parser-function))) You can indeed replace the cond with something like: (loop for rule in (grammar-rules grammar) when (funcall (condition-predicate rule) scanner) do (funcall (parser-function rule)))
<lisp123> pjb: Not sure if its clear, but basically I wanted to avoid having to create red-circle, but rather be able to write a method (defmethod paint ((obj circle) (obj red-color)) ...) -> (paint obj (color obj) and have it work
<lisp123> pjb: Yes I thought that too
<pjb> lisp123: (defclass colored-circle (circle) ((color :initarg :color :reader color)))
<pjb> Then you just use (make-instance 'colored-circle :color 'red) as a normal circle.
<bollu> [also, should I use slime? versus sly?]
notzmv has quit [Ping timeout: 240 seconds]
<lisp123> pjb: In that example, how do you write a method that specialises on color = red (apart from EQL specialisation)?
<rotateq> bollu: yes start with slime
<pjb> lisp123: why would you want to do that?
<bollu> rotateq okay
monaaraj has quit [Ping timeout: 256 seconds]
taiju has quit [Ping timeout: 240 seconds]
<bollu> rotateq How do I go the location of an error in slime? Like I said, when I press `v`, it takes me to the definition of `eval`, NOT to the definition of `assert-equal` from my source which is frustrating
<pjb> lisp123: (driver-behavior car (color semaphore))
<bollu> Like, I don't care about the details of the REPL. I want to see my code
<rotateq> bollu: for example i use spacemacs, then have left the source file buffer and right the REPL, then i can (re)evaluate forms with C-c C-c
<rotateq> ehm don't know
<pjb> lisp123: (defmethod driver-behavior (mobile (semaphore-color (eql 'red0))) …)
<bollu> so, on the stack frame, I do see a call to DEEPEQ, but it seems to be tagged as [fast-method] and heavily processed by SBCL
<bollu> There must be some way to run code in "debug mode"?
<Xach> frodef: (merge-pathnames relative absolute) is one way
<lisp123> pjb: Yes, that I get. But then you lose the inheritance structure of colors (perhaps there is pale-red, dark-red etc. and you want to specialise on red)
<lisp123> (pale-red and dark-red roll up into red)
<frodef> Xach: thanks.
myrrh has quit [Remote host closed the connection]
<frodef> ..what if I want to get at "foo/bar.zap" relative to some directory?
kevingal has quit [Ping timeout: 256 seconds]
<Xach> frodef: merge-pathnames works there too
<pjb> lisp123: colors are not structured, they're a continuum.
<pjb> lisp123: you need to perform an OO analysis first.
<pjb> lisp123: Of course, your analysis may lead you to things like green yellow red as symbols or semaphore states. But not colors.
<lisp123> pjb: Indeed. But this was more about an approach to take where I don't "lose" information
<pjb> (semaphore-state sem) -> #<semaphore-state red>
<pjb> Then you can have classes such as closed-semaphore-state open-semaphore-state etc.
<lisp123> pjb: That's a good idea actually, I will google this "semaphore" thing
<frodef> Xach: (merge-pathnames #p"/tmp/" #p"bar/foo.zap") -> #P"/tmp/foo.zap"
<pjb> lisp123: again, you must do the analysis!
<Xach> frodef: bar/foo.zap is relative. it should go first.
<Xach> (merge-pathnames relative abvsolute)
<lisp123> pjb: Thanks. By the way, do you have any recommended books?
<frodef> Xach: indeed. Thanks!
monaaraj has joined #commonlisp
<pjb> lisp123: eg. Grady Booch. "Object-oriented Analysis and Design with Applications, 3rd edition":http://www.informit.com/store/product.aspx?isbn=020189551X Addison-Wesley 2007. or Meyer, Bertrand (1988). Object-Oriented Software Construction. Cambridge: Prentise Hall International Series in Computer Science. p. 23. ISBN 0-13-629049-3.
<lisp123> pjb: Thanks <3!
<rotateq> oh Bertrand Meyer :)
<Xach> frodef: merge-pathnames is great. it takes a pathname and tries to make it complete in some way. so i sometimes have a function like (template-file name) => (merge-pathnames "foo" "/path/to/templates/template.html") => "/path/to/templates/foo.html"
<frodef> neat
<lisp123> pjb: Thanks for your help, I need to digest a lot of it. What was your lambda-list parser about? I didn't fully follow from the code
wyrd has quit [Quit: leaving]
<Xach> *default-pathname-defaults* also comes into play
<lisp123> Is it just reimplementing what CL already has?
<pjb> lisp123: parsing things like (a b &optional (o 42) &key (k1 nil k1p) ((k2 :rrr)))
<pjb> lisp123: CL doesn't have it. Each CL implementation has it, but none expose it publicly.
<lisp123> ah, and outside of a function / macro definition, as in in 'normal use'?
foxfromabyss has joined #commonlisp
<lisp123> Ah okay, so also to make it public
<lisp123> Cool stuff
<bollu> How do I disable SBCL optimizations? I have (declaim (optimize (debug 3))) defined in my file
<pjb> lisp123: (lambda-list-parameters (parse-lambda-list '(a b &optional (o 42) &key (k1 nil k1p) ((k2 :rrr))) :ordinary)) #| --> (#<&mandatory a #x302002E1E8CD> #<&mandatory b #x302002E1E87D> #<&optional (o 42) #x302002E1E80D> #<&key (k1 nil k1p) #x302002E1E76D> #<&key ((k2 :rrr)) #x302002E1E6DD>) |#
<bollu> But I still see `fast-method` during evaluation
<phoe> is there even a SLOW-METHOD in SBCL though?...
* phoe thinks
<Bike> yeah, the regular method function.
<phoe> OK
<Bike> fast methods are a deep part of the clos implementation. i don't think they can be turned off. they're not something the compiler is doing, for one.
<bollu> mn
<bollu> mh*
<phoe> but is that affected by optimization qualities at all?
<bollu> I then wonder how quicklisp gives me a cleaner (easier to use) stack trace
<bollu> does it not optimize?
<lisp123> pjb: Nice!
<phoe> too many variables in that question
igemnace has quit [Remote host closed the connection]
<phoe> bollu: what two stacktraces are you comparing
<Bike> what is the problem with the fast methods, exactly?
monaaraj has quit [Ping timeout: 240 seconds]
<bollu> Bike At the stack trace 1: ((:METHOD DEEPEQ (T T)) #<INST-ADD {1001E94723}> #<INST-ADD {1001E947A3}>) [fast-method], when I hit `v` (for view source), I am taken to something that is generated by SBCL. I would expect it to take me to the definition of DEEPEQ in my sources
<Bike> do any of the other frames take you to the method definition?
monaaraj has joined #commonlisp
<bollu> Bike Not as far as I can tell. It's all (EVAL <stuff>) which takes me to EVAL's definition, or (SLYNK <stuff>) or.. Here's all the frames, in case I missed something: https://gist.github.com/bollu/3a3146f5ff8964a97476ba46b24533f8
<Bike> hmm. and you compiled all this with debug 3, huh? surprising
<bollu> yes.
<bollu> Should I switch common lisp implementations?
<Bike> weren't you using lispworks?
<bollu> I was
<bollu> but then I wanted FSet
<jdz> bollu: If you want to inhibit libraries overriding your debug policy, you can use (sb-ext:restrict-compiler-policy 'debug 1) on SBCL.
<jdz> Use the appropriate number.
<Bike> i don't think this involves libraries
<bollu> trying to load FSet via ql makes lispworks run out of heap space on their personal edition :)
<bollu> This does not, no
<Xach> Perhaps it's something to do with using sly-eval-region instead of compiling or loading.
<Bike> oh wait, yeah.
<Bike> that might screw up the source info.
<bollu> Xach I'm using `sly-eval-buffer` to run the buffer.
<bollu> Should I use some other command?
<jdz> Something with a word "compile" in it, probably.
<Bike> C-c C-k sly-compile-and-load-file
<Bike> might be better
<Bike> i tried (deepeq (mk-inst-add :x :y 1) (mk-inst-add :x :y 1)) with your code from yesterday but there was no error, so i guess you've changed it since
attila_lendvai has quit [Ping timeout: 256 seconds]
<lisp123> pjb: I read through your comments and understand them now, thanks
miique has quit [Ping timeout: 240 seconds]
<bollu> Bike I'm having some CLOS differences between lispworks and SBCL it looks like
<bollu> Hence the compile error :)
<Bike> i mean, i ran it in sbcl
<bollu> thanks, compile-and-load-file does the job
<bollu> oh
<bollu> ?
<bollu> hmm
<bollu> then I don't know what's happening
<Bike> 2spooky.
<bollu> indeed :)
<bollu> can I get emacs to "teach me" keybindings? Like, I ran `M-x sly-compile-and-load-file`. I wish something in the interface would popup and say "You can use C-c C-k"
<Bike> it does that for me, actually, and i haven't configured anything. let me see if there's a switch
lisp123 has quit [Quit: Leaving...]
hobo has quit [Quit: ZNC 1.8.2 - https://znc.in]
<gabc> I think it's the M-x completion system? I don't think it's built-in in vanilla
hobo has joined #commonlisp
<Bike> you can also do C-h f sly-compile-and-load-file and it will list keybindings
<Bike> my emacs is pretty vanilla. hrm.
<gabc> um with emacs -q, M-x find- <TAB> the completion popup has keybindings
<gabc> but not if it auto completes to the full command
<gabc> well, TIL
<jdz> C-h w
<jdz> There's suggest-key-bindings.
foxfromabyss has quit [Ping timeout: 256 seconds]
nature has joined #commonlisp
taiju has joined #commonlisp
Jing has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
Jing has joined #commonlisp
monaaraj has quit [Ping timeout: 240 seconds]
wyrd has joined #commonlisp
<jfb4> bollu: typically Emacs normally suggests the keybinding after using M-x ... Try running emacs -Q and issuing some M-x command with a keybinding (eg M-x find-file)
<bollu> jfb4 okay, lemme try that!
<jfb4> bollu: you may wish to consider which-key-mode, which is very useful in showing possible bindings, eg for the common C-x or C-c
<bollu> so class-slots doesn't seem to exist on clos?
<beach> mop class-slots
<beach> bollu: You need the MOP for that.
sloanr has joined #commonlisp
<beach> bollu: You can use the system CLOSER-MOP to avoid implementation-specific package names.
<phoe> beach: I think I found a decent solution for the issue I mentioned and I wonder if it would make a good WSCL addition
wyrd has quit [Ping timeout: 276 seconds]
taiju has quit [Ping timeout: 240 seconds]
<beach> I am afraid I didn't follow the details. Can you summarize?
<phoe> yes, let me write this down
<phoe> if U-I-F-{R,D}-C causes a non-local exit, then the instance is restored to its previous state - it either becomes fully obsolete once again (in case of redefined class) or it is restored to its previous class and slot values (in case of different class)
<phoe> in other words, if an error interrupts U-I-F-{R,D}-C, then the programmer may try to fix up their code and try accessing the instance/changing its class again
wyrd has joined #commonlisp
<phoe> and the instance is not left in a "half-updated" state
<phoe> either it's obsolete/of old class or it's updated/of new class
<beach> Oh, so this is your solution you are describing?
<phoe> yes
<phoe> the problem is that U-I-F-{R,D}-C can signal an error and then the instance can be left in a half-baked state; the solution I propose is what I just wrote above
<beach> Well, for WSCL, I insist on looking at what current implementations do, and especially see whether they agree. It is likely they do since many use PCL.
<beach> I understand.
<phoe> SBCL currently leaves it in a half-baked state, but I've just prepared (my first ever) SBCL commit to implement and test this behavior
<beach> Sounds good.
<phoe> ;; and I hope this behavior makes sense
<beach> I am not (yet) convinced that your solution is the right one though.
<phoe> sure, I am thinking if there are better ones
<beach> I.e., I am not (yet) sure I see a problem with the "half-baked" behavior.
<phoe> OK, so a bit more context from my side - I am e.g. trying to a write a metaclass whose slots are always bound, and I want to handle redefinitions
<phoe> (defclass foo () () (:metaclass always-bound-class))
<phoe> (defvar *foo* (make-instance 'foo))
<phoe> then I want to redefine FOO to include a new slot
<beach> Ah, yes, that makes a bit more sense to avoid half-bakedness.
<phoe> (defclass foo () ((slot :initform 40)) (:metaclass always-bound-class))
<phoe> now (slot-value *foo* 'slot) causes my U-I-F-R-C to signal an UNBOUND-SLOT error, as intended
<phoe> but instead of providing a value for it, I invoke the ABORT restart
<phoe> ...and *foo* effectively has an unbound slot now
<phoe> err, sorry, not :initform 40 but :initarg :slot
<beach> I understand.
<phoe> if the instance is forced to stay obsolete until U-I-F-R-C completes successfully then this has a chance of signaling errors for as long as necessary, instead of silently allowing a half-updated instance to linger
<phoe> hence my idea
<beach> Yes, I see.
<beach> It may be overkill to specify such behavior as you suggest when it applies only to a particular case.
<beach> ... thinking in terms of WSCL I mean.
<phoe> yes, that's right
<phoe> I'm also thinking of "what would be the right thing to do in such a situation"
<phoe> like, is updating an instance/changing its class meant to be "transactional", as in either 100% done or 0% done
<beach> Sure.
<beach> Not obvious to me.
<phoe> and what would a programmer expect in such case
<phoe> the current behavior for errors in update-instance-* is wild west
<phoe> looking from another point of view: what would be a possible scenario in which it is feasible for U-I-F-{R,D}-C to signal an error and leave the instance's slots *not* updated?
<beach> In existing implementations you mean? Or in the standard?
<phoe> is there existing code that depends on such behavior?
<phoe> I mean in programmer practice
<phoe> the standard does not define any kind of error handling for that situation
<beach> Right.
<phoe> I'm thinking the way of "as a programmer, how could I try to treat this behavior as a feature?"
<beach> That's a good start.
<Alfr> phoe, maybe 3.7.2?
<phoe> clhs 3.7.2
<specbot> Transfer of Control during a Destructive Operation: http://www.lispworks.com/reference/HyperSpec/Body/03_gb.htm
<phoe> Alfr: yes, that works
<phoe> CHANGE-CLASS is definitely a destructive operation, and so is U-I-F-D-C
<phoe> so is U-I-F-R-C because the instance's insides are moved around
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
<phoe> then the state of such an instance depends on the implementation in question
<phoe> ...and I assume that convincing implementation maintainers to make a rollback in such a situation is a feasible thing to do
<phoe> especially if patches are provided
<Bike> in clasp, at least, update-instance-for-redefined-class is actually only called after the low level structure of the instance is changed.
<Bike> well, actually that's pretty much how the standard method is described too. it just checks the initargs (which is nonsense, but whatever) and calls shared-initialize.
<Bike> so by that point the class has been swapped out and the instance storage changed, presumably.
<Alfr> phoe, not sure it's feasible. Imagine for some class uif[dr]c would shuffel/replace the contents of a vector stored in it's slot, if that has happened and the error is signaled later, how would an implementation revert that in general?
<Bike> so rollback may be difficult.
<Bike> Alfr: i was assuming phoe meant the standard method would do this, and if a programmer defines their own method it's up to them.
<Alfr> Bike, ah ... okay. That'd at least exclude the case I just mentioned. :)
<phoe> the process in 4.3.6 is two-step, where the first step is munging the instance's storage and the second one is calling U-I-F-R-C
<Bike> right.
<phoe> and my proposal is, effectively, rolling back the first step if U-I-F-R-C signals an error
<Bike> and then let the error continue propagating?
<phoe> so then the programmer may fix up their code and "try again"
<phoe> Bike: yes
<Bike> mhm.
<phoe> hmmm
<phoe> ...
<phoe> should it be actually, it signaling an error, or it exiting via a non-local exit
<Bike> the latter.
<phoe> I think the latter - an error can be handled, e.g. a STORE-VALUE restart may be used from the debugger to store a value in a slot that must not be unbound
<phoe> good, then my SBCL patch makes sense
<phoe> s/can be handled/can be handled without leaving U-I-F-R-C/
<Bike> the rollback would presumably be done by the (unwind-protect (progn (u-i-f-r-c ...) (setf done t)) (unless done do-rollback)) kind of pattern.
<phoe> Bike: exactly what I did
<Bike> hmm. think this could be done in clasp, probably. for redefined class, at least, haven't looked at different
<phoe> different is easier to think of, because you have the copy
<phoe> you should be able to move stuff back from the copy to the original, at least that's what happens in SBCL
<phoe> s/SBCL/my SBCL patch/
<Bike> think different-class would be ok too. the sicl rack design means it's mostly just switching the rack in the primitive instance
<Bike> oh, wait, but then there's my weird optimization, lessee
kevingal has joined #commonlisp
thomaslewis has joined #commonlisp
<Bike> ok, so what happens if a user method on change-class, rather than u-i-f-d-c, transfers control?
<Bike> an :after method, say. is rollback done?
thomaslewis has left #commonlisp [#commonlisp]
<phoe> hmmm
<phoe> the user has direct control over that at that point, so it should be up to think I think
<phoe> as in, the primary method has already executed
<phoe> s/to think I think/to them I think/
frgo has joined #commonlisp
<phoe> I assume that the whole primitive operation of changing the object's class and munging its insides happens inside CHANGE-CLASS's primary method (or, rather, the system-defined methods)
<Bike> yes.
waleee has quit [Ping timeout: 268 seconds]
<phoe> the question is, how can you even trigger a rollback in such a situation
<phoe> CHANGE-CLASS :AFTER specialized on a non-standard class is going to be the last to execute
<phoe> (well, unless we count in CHANGE-CLASS :AROUND)
<phoe> (and then that specialized on a custom class is going to be the last to execute, again)
<phoe> I think that the transaction should cover the system-defined methods of CHANGE-CLASS only - the reason is that this is the only part that the programmer is unable to easily re-invoke, as it computes arguments to and calls U-I-F-D-C on its own
<phoe> but I'm open to suggestions and things that can go wrong with this idea
Oladon has joined #commonlisp
notzmv has joined #commonlisp
nij- has joined #commonlisp
paul0 has quit [Remote host closed the connection]
paul0 has joined #commonlisp
thomaslewis has joined #commonlisp
<Bike> spose that works. and for the same reason reinitialize-instance isn't really a problem
<phoe> yep
<phoe> I-I isn't a problem in most cases because it's most commonly used from within MAKE-INSTANCE and therefore there is no instance that the user can treat as half-baked
<phoe> and if they manually ALLOCATE-INSTANCE then the instance is half-baked by definition unless I-I successfully brings it to 100% bakeness
Jing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee has joined #commonlisp
VincentVega has joined #commonlisp
jstoddard has joined #commonlisp
<jackdaniel> allocate-instance may be used to create a container for a shallow copy of another instance
<phoe> yes, but then you usually iterate over and copy slots manually instead of calling INITIALIZE-INSTANCE, right?
<phoe> if you don't call I-I then you don't need to care about errors in I-I
<jackdaniel> sure
<phoe> OK - I understood what you mean
<phoe> "unless I-I successfully brings it to 100% bakeness" → "unless I-I *or some other programmer intervention* successfully brings it to 100% bakeness"
Josh_2 has joined #commonlisp
<Josh_2> Hi
<Josh_2> https://github.com/mattmundell/nightshade Is this a fork of cmucl?
Demosthe1ex is now known as Demosthenex
<phoe> "As of version 1b Nightshade is most probably entirely public domain. It is based on CMUCL 18c."
<phoe> from COPYING in that directory
<Bike> how mysterious.
mingus has joined #commonlisp
Xach has quit [Ping timeout: 252 seconds]
varjag has quit [Ping timeout: 256 seconds]
<phoe> beach: this "exercise" project so far found one bug in SBCL and one possible way forward for implementation-dependent behavior
<phoe> I think I'm going to continue it
Alfr has quit [Remote host closed the connection]
Alfr has joined #commonlisp
mingus has quit [Ping timeout: 268 seconds]
jealousmonk has joined #commonlisp
waleee has quit [Ping timeout: 268 seconds]
Xach has joined #commonlisp
waleee has joined #commonlisp
domovod has quit [Quit: WeeChat 3.4]
sloanr has quit [Ping timeout: 240 seconds]
nij- has quit [Quit: Using Circe, the loveliest of all IRC clients]
Xach has quit [Ping timeout: 256 seconds]
mikko has quit [Quit: WeeChat 2.7.1]
mingus has joined #commonlisp
alcaeus has joined #commonlisp
<Josh_2> phoe: what are you doing?
psf has quit [Read error: Connection reset by peer]
Xach has joined #commonlisp
<phoe> Josh_2: playing around with MOP in context of error handling
psf has joined #commonlisp
<Josh_2> Sounds interesting, do you have any examples?
<bollu> beach thanks for pointing me to closer-mop. Why weren't these names standardized in the common lisp spec?
kevingal has quit [Ping timeout: 240 seconds]
<phoe> Josh_2: yes, one second
sloanr has joined #commonlisp
<jackdaniel> bollu: mop was still under development when the standard was published
<Josh_2> bollu: because the MOP isn't standard
<jackdaniel> some choices in the standard are influenced by ungergoing effort to specify the metaobject protocol
<bollu> I see
<jackdaniel> (i.e compute-applicable-methods was defined as a generic function while originally it was proposed as an ordinary one)
<jackdaniel> so some choices are deliberely forward compatible with then-upcoming mop specification
mingus has quit [Ping timeout: 256 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<Josh_2> phoe: Thanks
psf has quit [Read error: Connection reset by peer]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
psf has joined #commonlisp
theothornhill has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
<bollu> where do I find docs for closer-mop?
<phoe> *unless* you are looking for something that's specific to CLOSER-MOP the library and not to MOP in general
<bollu> damn, neat
<phoe> for these, there's https://github.com/pcostanza/closer-mop/blob/master/features.txt and generally sources on github
<phoe> and the README there has some details
<phoe> generally, using CLOSER-MOP should bring you as close to the MOP specification as possible, no matter what implementation you are on
alcaeus has quit [Ping timeout: 256 seconds]
Oladon has quit [Quit: Leaving.]
mingus has joined #commonlisp
theothornhill has quit [Remote host closed the connection]
theothornhill has joined #commonlisp
zoglesby has quit [Remote host closed the connection]
zoglesby has joined #commonlisp
rain3 has quit [Ping timeout: 240 seconds]
mingus has quit [Ping timeout: 240 seconds]
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
mingus has joined #commonlisp
zoglesby has quit [Remote host closed the connection]
zoglesby has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 27.1]
xmyst has joined #commonlisp
VincentVega has quit [Read error: Connection reset by peer]
VincentVega has joined #commonlisp
mingus has quit [Ping timeout: 256 seconds]
nij- has joined #commonlisp
mgl has quit [Ping timeout: 256 seconds]
nij- has quit [Quit: Using Circe, the loveliest of all IRC clients]
aartaka has quit [Ping timeout: 256 seconds]
hobo has quit [Ping timeout: 268 seconds]
<etimmons> Anyone out there with the latest version of LispWorks? Can you check if :package-local-nicknames is on _features_ ?
tyson2 has quit [Remote host closed the connection]
<rotateq> no sry :/
<jgart> What testing libraries/frameworks does the community recommend/prefer and why? FiveAM?
cosimone has quit [Ping timeout: 252 seconds]
Lord_Nightmare has quit [Ping timeout: 256 seconds]
<jeosol> good morning guys
<rotateq> good morning jeosol
<jeosol> jgart: I recall sabra did some comparison of testing frameworks you can check the article out. I don't have the link right way but you can find it with a google search
Alfr has quit [Remote host closed the connection]
<jeosol> I think parachute by shinmera (I think) scored high in his reviews. I have used prove/rove, settled on fiveam/fiveam-asdf (integration with asdf) and then I am using parachute now
<jeosol> rotateq: thanks
<rotateq> get some parentheses for breakfast
<jeosol> haha, cool. I haven't had a meal today, past 3pm and could use some defun and parentheses
Lord_Nightmare has joined #commonlisp
<rotateq> but don't pepper it with structs
<jeosol> is anyone here CL with some sort of message queuing system (persistent ones like rabbitmq).
<jeosol> rotateq: haha
<rotateq> phew yesterday evening i tried again loading the qvm (with quicklisp) and it wants this libffi.so.7 but i just have and seem to get 8
<rotateq> jeosol: or ZeroMQ ;)
<jeosol> I think I did see zeromq, but last time I checked it, I think it is not persistent if I recall
<rotateq> but they should rewrite it with C and ecl
<jeosol> I could be wrong.
<rotateq> i used it a bit some years ago but just the simplest patterns
<rotateq> ah okay, persistent
<jeosol> Basically, the messages for what I am doing can't be lost otherwise it messes up the whole thing. I am doing iterative optimization and if a solution is not evaluated, then it messes up the search.
karlosz has joined #commonlisp
<jeosol> In some systems, the message leaves the queue after it receives acknowledge from a consumer that the message has been processed. Only then does the mesage leave the queue. If the consumer fails to process it, then it's still there in the queue
<rotateq> rabbitmq was with erlang, right?
<jeosol> I wanted to demonstrate CL to some people, but we butt heads a bit why I don't use python (I do use python but not for very computational tasks)
<rotateq> or 'is'
<jeosol> yes, I heard rabbitmq is written in erlang, and it's a very good piece of software - watched a few videos
<rotateq> jeosol: say you use python, the compiler in SBCL originating from CMUCL
<jeosol> hahaha,
<jeosol> not that python
<rotateq> yes erlang is great too for what it fits
<jeosol> the one most people use in the AI/ML space
<rotateq> yes of course i inferred :P
<jeosol> when I started using CMUCL, I realized the compiler was called python, and I was a bit confused
<rotateq> hihi
Lord_Nightmare has quit [Quit: ZNC - http://znc.in]
Alfr has joined #commonlisp
<rotateq> like with WEB for Knuth's literate programming system. more things than names
<jeosol> rotateq: haha, Python and the version issues - can drive you nuts. This is something we don't worry much in CL. I upgrade monthly with SBCL and I rarely get issues and any can be resolved quickly
<rotateq> jeosol: even on NixOS it's still a MESS
Alfr has quit [Remote host closed the connection]
<rotateq> yes like the myth of Java legacy :D
Lord_Nightmare has joined #commonlisp
<jeosol> When I started working CL, the fact that I have worry about environments was jarring. It was aeth or someone here that told me to see each python version as a different language
<jeosol> Java and it's stack traces
<rotateq> "we take this piece of 30 years old CL code and push it into the newer impl" maybe sometimes some modifications due to CLtL1
<jeosol> yes, usually, they'd be some little things here and there, but you can get it going in no time. emacs, slime, paredit, etc helps as you can go anywhere and fix issues. It's a shame that emacs prevents people from exploring CL
<rotateq> or across impls and platforms with the power of #+ and #-
<jeosol> I understand it has some steep learning curve. Gladly I think some efforts are going on  with other editors I seem to recall
tyson2 has joined #commonlisp
<rotateq> ah you maybe mean climacs2
<rotateq> maybe I try to build qvm with its Makefile (urgs)
<jeosol> I think a long time I heard about atom, and another, not sure it's vscode.
<rotateq> jeeeeez no
<jeosol> by the way, I found this librray: https://github.com/lokedhs/cl-rabbit
<jeosol> I will explore it more.
<rotateq> nice, follow the white rabbit
karlosz has quit [Quit: karlosz]
<jeosol> You don't like any of those editors? I only use vscode when I have to work with python.
<rotateq> no I don't, they all converge to the *idea* of emacs too (not a certain implementation)
<rotateq> yes okay :)
<pjb> jeosol: python is an horrible programming language, because it distinguishes statements from expressions. CL is very nice a programming language because there are only expressions.
<pjb> jeosol: (+ 1 (print (+ 1 1))) #| prints: 2 --> 3 |#
hobo has joined #commonlisp
<pjb> jeosol: In lisp you can write: (if (zerop (random 2)) (+ x 1) (+ x 2)) === (+ x (if (zerop (random 2)) 1 2)) ; try to do that in Python!
<jeosol> pjb: I don't argue that at all. Unfortunately, I had to butt heads with these guys every  now and then (ML/AI work). For my work is often slow and writing parallel code is a pain (some GIL bullsh*t I hear). They say its the #1 language now, on TIOBE
<jeosol> pjb: haha
<jeosol> pjb: good examples
<pjb> jeosol: it's just a simple example, but it factor to bigger examples, and it explains programmer's productivity in CL.
<rotateq> when things even break in simple things ..
pillton has joined #commonlisp
<jeosol> pjb: good point. As a matter of fact, I have been trying to gather pointers, articles and concrete evidence that explains why programming in CL is very productive. I think beach shared a paper sometime that, not directly on CL but on similarly languages - I don't have it handly now
<pjb> jeosol: also http://cliki.net/Performance
<jeosol> as beach and others have said, it's not use engaging in this type of conversations, but I get ask why I am evening coding in emacs, and then they see my screen with lots of parentheses and ask what is the hell is this language, haha
<jeosol> pjb: thanks, this is great, this will help me articulate things better. Much appreciated
<jeosol> The paper I was referring to is the first one in that link
cranium has quit [Quit: Leaving]
pranavats has left #commonlisp [Error from remote client]
contrapunctus has left #commonlisp [#commonlisp]
Oladon has joined #commonlisp
contrapunctus has joined #commonlisp
gaqwas has joined #commonlisp
Alfr has joined #commonlisp
pranavats has joined #commonlisp
nature has quit [Ping timeout: 256 seconds]
wyrd has quit [Quit: leaving]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
gaqwas has quit [Remote host closed the connection]
karlosz has joined #commonlisp
<moon-child> pjb: I'm pretty sure you can do that in python though
notzmv has quit [Ping timeout: 268 seconds]
<moon-child> expression-orientation is not bad, but it's just gravy
<moon-child> something like TAGBODY always returns nil, it would be rather useless (or at least obfuscatory) to use it as an expression
miique has joined #commonlisp
cosimone has joined #commonlisp
nature has joined #commonlisp
akoana has joined #commonlisp
xmyst has quit [Ping timeout: 240 seconds]
nature has quit [Ping timeout: 256 seconds]
hobo has quit [Quit: ZNC 1.8.2 - https://znc.in]
cosimone has quit [Read error: Connection reset by peer]
cosimone has joined #commonlisp
random-nick has quit [Ping timeout: 256 seconds]