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/>
seletz has joined #commonlisp
attila_lendvai has joined #commonlisp
dipper has joined #commonlisp
son0p has joined #commonlisp
Oladon has quit [Quit: Leaving.]
seletz has quit [Ping timeout: 248 seconds]
<dsx> Hello. Can someone recommend good examples of common lisp code to read for beginner?
<Catie> ray
<Catie> Shucks, sorry about that, I had the wrong window focussed
eddof13 has joined #commonlisp
tibfulv has quit [Remote host closed the connection]
tibfulv has joined #commonlisp
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dra_ has joined #commonlisp
dra has quit [Ping timeout: 256 seconds]
emacs-dwim has joined #commonlisp
Mitpatral has joined #commonlisp
dra_ has quit [Quit: Leaving]
Mitpatral has quit [Client Quit]
jeffrey has quit [Quit: Client quit]
xaltsc has quit [Ping timeout: 260 seconds]
xaltsc has joined #commonlisp
asarch has joined #commonlisp
<edgar-rft> dsx: free book + code -> https://github.com/norvig/paip-lisp
nij- has joined #commonlisp
tyson2 has joined #commonlisp
azimut has quit [Ping timeout: 255 seconds]
azimut has joined #commonlisp
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
nij- has joined #commonlisp
notzmv has joined #commonlisp
eddof13 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Lycurgus has joined #commonlisp
epony has quit [Ping timeout: 268 seconds]
jrm has joined #commonlisp
Lycurgus has quit [Quit: Exeunt https://tinyurl.com/4m8d4kd5]
tetsuo9 has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
dipper has quit [Remote host closed the connection]
dipper has joined #commonlisp
asarch has quit [Quit: Leaving]
nij- has quit [Ping timeout: 260 seconds]
seletz has joined #commonlisp
seletz has quit [Ping timeout: 264 seconds]
epony has joined #commonlisp
attila_lendvai has quit [Ping timeout: 248 seconds]
igemnace has joined #commonlisp
frodef_ has joined #commonlisp
frodef has quit [Ping timeout: 268 seconds]
dipper has quit [Remote host closed the connection]
dipper has joined #commonlisp
Lycurgus has joined #commonlisp
Lycurgus has quit [Quit: Exeunt https://tinyurl.com/4m8d4kd5]
larix has joined #commonlisp
ebrasca has joined #commonlisp
<ebrasca> Morning!
waleee has quit [Ping timeout: 252 seconds]
seletz has joined #commonlisp
seletz has quit [Ping timeout: 265 seconds]
aartaka has joined #commonlisp
ebrasca has quit [Remote host closed the connection]
ebrasca has joined #commonlisp
rgherdt has joined #commonlisp
jmdaemon has quit [Ping timeout: 260 seconds]
aartaka has quit [Ping timeout: 252 seconds]
aartaka has joined #commonlisp
prokhor has quit [Ping timeout: 265 seconds]
varjag has joined #commonlisp
frgo has quit [Ping timeout: 256 seconds]
_cymew_ has joined #commonlisp
easye has quit [Ping timeout: 264 seconds]
easye has joined #commonlisp
seletz has joined #commonlisp
_cymew_ has quit [Ping timeout: 255 seconds]
Cymew has joined #commonlisp
enzuru has quit [Quit: ZNC 1.8.2 - https://znc.in]
enzuru has joined #commonlisp
notzmv has quit [Ping timeout: 265 seconds]
shka has joined #commonlisp
random-nick has joined #commonlisp
jeosol has joined #commonlisp
azimut has quit [Ping timeout: 255 seconds]
aartaka has quit [Ping timeout: 248 seconds]
aartaka has joined #commonlisp
ttree has quit [Ping timeout: 264 seconds]
ebrasca has quit [Remote host closed the connection]
MajorBiscuit has joined #commonlisp
larix has quit [Quit: Leaving]
causal has quit [Quit: WeeChat 3.7.1]
<antoszka> Yo guys, what's the "go-to" swank client for Vim or Neovim these days? I haven't checked in, like, years and I'm curious of there's been any progress, something with the usability level of Slime maybe?
aartaka has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
_cymew_ has joined #commonlisp
Lord_of_Life has joined #commonlisp
<hayley> SLIMV?
notzmv has joined #commonlisp
<antoszka> Dunno. That's what I'm asking ;)
aartaka has quit [Ping timeout: 260 seconds]
<jackdaniel> try it and see, each time the vim topic pops up slimv is recomended (and vlime is mentioned) and people who use it are apparently satisfied
aartaka has joined #commonlisp
<antoszka> OK, cool, thanks.
sloanr has quit [Remote host closed the connection]
sloanr has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
aartaka has joined #commonlisp
_cymew_ has quit [Ping timeout: 252 seconds]
dipper has quit [Remote host closed the connection]
dipper has joined #commonlisp
Brucio-61 has quit [Remote host closed the connection]
Brucio-61 has joined #commonlisp
_cymew_ has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.7.1]
perrierjouet has joined #commonlisp
cage has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
_cymew_ has quit [Ping timeout: 256 seconds]
Lycurgus has joined #commonlisp
cosimone has joined #commonlisp
White_Flame has quit [Remote host closed the connection]
White_Flame has joined #commonlisp
frgo has joined #commonlisp
Ellenor has joined #commonlisp
ym has joined #commonlisp
Posterdati has quit [Ping timeout: 265 seconds]
Lycurgus has quit [Quit: Exeunt https://tinyurl.com/4m8d4kd5]
ebrasca has joined #commonlisp
pve has joined #commonlisp
cosimone has quit [Ping timeout: 248 seconds]
Posterdati has joined #commonlisp
pranavats has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
pranavats has joined #commonlisp
doyougnu has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
aartaka has quit [Ping timeout: 248 seconds]
seletz has quit [Ping timeout: 260 seconds]
<splittist> antoszka: and report back (:
pranavats has joined #commonlisp
seletz has joined #commonlisp
aartaka has joined #commonlisp
tyson2 has joined #commonlisp
ec_ has quit [Ping timeout: 255 seconds]
ec_ has joined #commonlisp
doyougnu has quit [Ping timeout: 246 seconds]
doyougnu has joined #commonlisp
goober has quit [Remote host closed the connection]
ec_ has quit [Remote host closed the connection]
ec_ has joined #commonlisp
gxt has quit [Ping timeout: 255 seconds]
anticomputer has quit [Ping timeout: 255 seconds]
gxt has joined #commonlisp
dipper has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
_cymew_ has joined #commonlisp
doyougnu has quit [Remote host closed the connection]
aartaka has quit [Ping timeout: 256 seconds]
aartaka has joined #commonlisp
gxt has quit [Remote host closed the connection]
anticomputer has quit [Remote host closed the connection]
ec_ has quit [Remote host closed the connection]
pdietz has joined #commonlisp
azimut has joined #commonlisp
sloanr has quit [Remote host closed the connection]
sloanr has joined #commonlisp
NotThatRPG has joined #commonlisp
notzmv has quit [Ping timeout: 248 seconds]
anticomputer has joined #commonlisp
szkl has quit [Quit: Connection closed for inactivity]
ec_ has joined #commonlisp
gxt has joined #commonlisp
Inline_ has joined #commonlisp
Inline has quit [Ping timeout: 252 seconds]
Bicyclidine has joined #commonlisp
easye has quit [Remote host closed the connection]
easye has joined #commonlisp
nij- has joined #commonlisp
Cymew has quit [Ping timeout: 268 seconds]
goober has joined #commonlisp
goober has quit [Client Quit]
morganw has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
pranavats has joined #commonlisp
thuna` has joined #commonlisp
Inline_ has quit [Quit: Leaving]
seletz has quit [Ping timeout: 256 seconds]
<dsx> phoe, edgar-rft thank you!
aartaka has quit [Ping timeout: 252 seconds]
pranavats has left #commonlisp [Error from remote client]
aartaka has joined #commonlisp
Oladon has joined #commonlisp
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
igemnace has quit [Remote host closed the connection]
aartaka has quit [Ping timeout: 264 seconds]
aartaka has joined #commonlisp
NotThatRPG_ has joined #commonlisp
alejandrozf has joined #commonlisp
NotThatRPG has quit [Ping timeout: 256 seconds]
ttree has joined #commonlisp
NotThatRPG_ has quit [Ping timeout: 256 seconds]
sloanr has quit [Remote host closed the connection]
sloanr has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 260 seconds]
jolby has joined #commonlisp
<mfiano> I started my Lisp journey with slimv and used it for about 6 years before I gave in and learned Emacs. The experience is much more seamless and featureful with SLIME or SLY on Emacs; like night and day. I also recently, like a couple years ago, spent a few months writing a few thousand line Vim/Neovim configuration to try to get vlime patched up to be comparable to the Emacs experience, and it
<mfiano> just...wasn't going anywhere after a while. I think if you are a Vim user you will be happy with either choice, but if you are a serious Lisp hacker, you won't know what you're missing. My 2c
Bicyclidine has quit [Quit: Client closed]
NotThatRPG has joined #commonlisp
gxt has quit [Ping timeout: 255 seconds]
gxt has joined #commonlisp
chrcav has quit [Ping timeout: 264 seconds]
chrcav has joined #commonlisp
ttree has quit [Ping timeout: 248 seconds]
pranavats has joined #commonlisp
ttree has joined #commonlisp
dsx has quit [Quit: dsx]
<alejandrozf> Good morning Lispers
<alejandrozf> I got this:
<alejandrozf> I thougth that nth-value shouldn't be marked as an special operator because of clhs 3.1.2.1.2.1
<alejandrozf> can you help me to clarify if it's a bug or not?
<mfiano> clhs 3.1.2.1.2.1
pranavats has left #commonlisp [Error from remote client]
pranavats has joined #commonlisp
dsx has joined #commonlisp
<Catie> So it looks like "special forms" and "special operators" are distinct categories?
<mfiano> a special operator is just the car of a special form.
sloanr has quit [Remote host closed the connection]
sloanr has joined #commonlisp
<mfiano> I remember something along the lines of macros allowed to be implemented as special operators or something, but maybe I'm just losing my mind because I can't find it. I also haven't looked at CL in about 6 months until this week so...
<Catie> I guess I'm caught on the phrase "special evaluation rules", whether or not that includes macros' delayed argument evaluation or not
<Catie> Oh "special form . a list, other than a macro form ..."
<mfiano> A special operator is a one of a set of 25 CL symbols that when appearing in CAR position of a form, produce a special form, with special evaluation rules, that cannot be implemented as a macro, or the standard decided not to.
cosimone has joined #commonlisp
jolby has quit [Quit: Client closed]
gxt has quit [Ping timeout: 255 seconds]
aartaka has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
gxt has joined #commonlisp
Devon has joined #commonlisp
ym has quit [Ping timeout: 260 seconds]
<phoe> alejandrozf: sounds like a bug to me
sloanr has quit [Remote host closed the connection]
<phoe> AFAIK it's permissible for the implementation to define new special operators, but not define additional CL symbols to be ones
sloanr has joined #commonlisp
<_death> clhs 3.1.2.1.2.2
<_death> "An implementation is free to implement a Common Lisp special operator as a macro. An implementation is free to implement any macro operator as a special operator, but only if an equivalent definition of the macro is also provided."
azimut has quit [Ping timeout: 255 seconds]
<phoe> I have been proven wrong
<phoe> _death: thanks, today I remembered
<mfiano> I have remembered something half right
<_death> I agree that there's an inconsistency there
<Catie> I remembered not a damn thing, but I sure learned something
cosimone` has joined #commonlisp
Devon has quit [Ping timeout: 265 seconds]
waleee has joined #commonlisp
azimut has joined #commonlisp
cosimone has quit [Ping timeout: 268 seconds]
<alejandrozf> ok, thank you so much guys, it seems it is not a bug after all, but it was confuse to me
sloanr has quit [Remote host closed the connection]
sloanr has joined #commonlisp
jolby has joined #commonlisp
alejandrozf has quit [Ping timeout: 256 seconds]
varjagg has joined #commonlisp
waleee has quit [Ping timeout: 264 seconds]
sloanr has quit [Remote host closed the connection]
sloanr has joined #commonlisp
Oladon has quit [Quit: Leaving.]
waleee has joined #commonlisp
Inline has joined #commonlisp
Devon has joined #commonlisp
Inline has quit [Max SendQ exceeded]
Inline has joined #commonlisp
Inline has quit [Read error: Connection reset by peer]
Inline has joined #commonlisp
waleee has quit [Ping timeout: 260 seconds]
Inline has quit [Max SendQ exceeded]
asarch has joined #commonlisp
Inline has joined #commonlisp
NotThatRPG has quit [Ping timeout: 256 seconds]
NotThatRPG has joined #commonlisp
cosimone` has quit [Remote host closed the connection]
cosimone has joined #commonlisp
aartaka has quit [Ping timeout: 246 seconds]
Inline has quit [Quit: Leaving]
waleee has joined #commonlisp
Inline has joined #commonlisp
Inline has quit [Remote host closed the connection]
pve has quit [Quit: leaving]
jmdaemon has joined #commonlisp
_cymew_ has quit [Ping timeout: 260 seconds]
Devon has quit [Ping timeout: 255 seconds]
szs has joined #commonlisp
peterhil has joined #commonlisp
cosimone` has joined #commonlisp
cosimone has quit [Ping timeout: 268 seconds]
asarch has quit [Quit: Leaving]
nij- has joined #commonlisp
<nij-> I have two objects of the same class I defined. How do I define equality for them?
mariari has quit [Read error: Connection reset by peer]
<pdietz> You can't make any builtin equality function change on them.  You can define your own equality function, probably generic, and define methods for it.
<Bike> lisp doesn't have a general extensible equality operator to specialize, if that's what you mean. instead you usually pass a particular comparator to whatever operation, e.g. the :test arguments to sequence functions
<Bike> so you can just write a normal function that compares two of your things, and pass that around
<pjb> nij-: equality is just an equivalence relationship. Any equivalence relationship can be useful. Which one do you want?
<pjb> nij-: for example, Pascal equals Bernard modulo their height!
<pjb> or Pascal equals pjb modulo their nicknames.
euandreh has joined #commonlisp
jolby has quit [Quit: Client closed]
<Josh_2> (defgeneric equals ..) (defmethod equals ((a myclass)(b myclass)) (string= (id a)(id b))) :sunglasses:
<nij-> I see. I will define my own..
<pdietz> It can make sense to define a group of functions together: equality, hash function, canonicalization, copier.
<nij-> How to loop over all slots?
<nij-> Should I use MOP for that?
Devon has joined #commonlisp
<nij-> I want to say if all slots are #'equal, then two objects are #'equals.
<Josh_2> You can use closer-mop:class-slots or class-direct-slots etc
<Catie> You might want it to be all slots #'equals if you plan on storing a class in a slot
<pdietz> A nice way to loop over all slots is to put each slot in a superclass by itself, then do something on each slot using method combination that combines individual methods on those superclasses.
<aeth> the only problem is that stuff like this is best done in a utility library so it's used in many, many places
<nij-> Must I use MOP?
<phoe> (dolist (slot (moptilities:slot-names ...)) ... (slot-value thing slot) ...)
<phoe> nij-: yes, there is no standard and efficient way of getting all slots of a class without MOP
<phoe> in theory you could DO-ALL-SYMBOLS over SLOT-EXISTS-P but that would be literally the worst way to approach this problem
<aeth> Personally, I have generics defined for CLEANUP and NAME because nearly every DEFCLASS has a NAME and just about every wrapped resource with a WITH- will want a CLEANUP. But I don't try to define my own shallow copy/equality methods automatically and if I had them, I'd just require that the user defines them.
<nij-> I defined the class PERSON as in https://lispcookbook.github.io/cl-cookbook/clos.html
<nij-> But (closer-nop:class-direct-slots 'person) tells me that there's no applicable method.
<Josh_2> (find-class 'person)
<nij-> Yes! Thanks folks!
cage has quit [Quit: rcirc on GNU Emacs 27.1]
<_death> probably better to explicitly say what you want to compare (and use readers) and how.. slots are implementation details, and it's not difficult to imagine a scenario where two objects should be treated as equivalent but have slots that are quite different (say caches, audit trails, etc.)
<Josh_2> Assign a unique ID to each person and compare those
<pjb> pdietz: assume you have (defclass person () (… (age :type integer))) What should (equals (in-year 2022 (make-instance 'person :name "Pascal" :birthday (date 1980-01-01))) (in-year 2002 (make-instance 'person :name "Pascal" :birthday (date 1980-01-01)))) give?
mariari has joined #commonlisp
<aeth> _death: right... the problem is that slots don't really matter, *accessors* do, and you can't really determine that automatically like you can with slots
<phoe> pjb: depends on the contents of the ellipsis
<pjb> pdietz: the point is that a class can have slots that are computed and contextual, and that should not be used in an equals function. birthdate ok, age not.
<phoe> and, huh, you have some sort of IN-YEAR there; I assume it establishes some dynamic scope?
<pjb> phoe: yes; a context.
<aeth> given the problem, it's probably best to just have a macro DEFINE-EQUALITY-METHOD that takes a list of readers (from the accessors) that matter for equality
<pjb> Am I the same person as I was yesterday?
<phoe> that would be another variable then, how this context affects instance creation
euandreh has quit [Quit: euandreh]
<phoe> pjb: no two rivers are equal
<_death> one cannot step twice in the same river
<pjb> We assume identity but animals are bunches of cells that live and die, and are entirely renewed every 9 months.
<nij-> OH.. I realize once I defined #'equals for my class, I need to define those for list-of-such-objects, hash-table-of-such-objects.. and so on.
<nij-> Doesn't seem to be a nice design..
<_death> (heraclitus)
<nij-> Any thoughts?
<pjb> (not all at the same time, eg. red cells last about 3 months).
<Josh_2> _death: :sunglasses:
<aeth> nij-: oh, that comes for free, actually
<nij-> ?
<aeth> nij-: just recursively call it when given a sequence or hash table
<pjb> nij-: check cdr-8
<aeth> nij-: and define an implementation for all built-ins using one of the built-in equalities
<pjb> There's an equals system in quicklisp.
<remexre> cl-ppcre can't work over byte arrays, right?
Devon has quit [Ping timeout: 260 seconds]
<nij-> (I will think about it. I have to run for 30 minutes.)
<nij-> "equals"?
jolby has joined #commonlisp
<aeth> nij-: I mean it comes for free because (defmethod equals ((a sequence) (b sequence)) (every #'equals a b)) (equals nil nil) => T
<aeth> assuming you define equals on every built-in somehow
<aeth> hash tables are a little more complicated, probably. They probably require a LOOP
<Josh_2> There is a generics library for CL that converts much of the standard library into generic functions
<phoe> generic-cl AFAIK
<_death> aeth: that looks buggy :)
<pjb> so you already have the methods for lists, arrays, etc.
<_death> aeth: note that (every #'equal '(1 2 3) '(1 2)) => true
<aeth> ah
<aeth> I know you would have to check the size for hash tables since you're just seeing if :A in A equals :A in B
<aeth> I guess you have to do that for sequences, too. Not too bad
<aeth> (actually hash-table-count, not hash-table-size)
<Josh_2> The solution is #'eq :joy:
<Alfr> Josh_2, yeah, like (eq 5 5) => nil
<aeth> The hardest part with this generic will actually be numbers because you'll need to define what you mean by equality there. The highest level is #'= and not one of the built-in more generic ones but is that what you want? Do you want (equals 1 1f0) to be T or NIL?
<Josh_2> Well if you want to be 100% sure that the two instances of person are the same
<Josh_2> #'eq will do that :P
<aeth> (You'd also probably want strings to be a special case that uses string= instead of the generic sequence solution)
<phoe> there's a lot of these popping up as of late
<Josh_2> This one is built from a version written by some fella in 1994, I wonder how accurate it is
Devon has joined #commonlisp
nij- has quit [Ping timeout: 256 seconds]
<phoe> hmmm, if only we knew what happened in 1994
<aeth> pre-Wikipedia so we can't ever know for sure
<morganw> the source files are still actively maintained (at least, it looks like there are updated for texinfo changes) in the Gcl repository
cosimone` has quit [Remote host closed the connection]
Inline has joined #commonlisp
nij- has joined #commonlisp
<nij-> I'm back. Oh, I see. Either way, I need to define equals for all classes derived from my class. Using libs counts use defining too.
dnc has joined #commonlisp
<nij-> Hmmmmmm. #'slot-value only takes slot-name but not slots themselves.
Devon has quit [Ping timeout: 260 seconds]
Catie has quit [Ping timeout: 255 seconds]
Devon has joined #commonlisp
Lycurgus has joined #commonlisp
<nij-> Oh, this can be solved by closer-mop:slot-definition-name.
<nij-> Hmm.. now I'd like to copy object. Should I also write a #'copy-obj by myself using closer-mop? Or there are better tools?
<phoe> has http://www.nhplace.com/kent/PS/EQUAL.html been linked yet?
causal has joined #commonlisp
szs has quit [Remote host closed the connection]
Devon has quit [Ping timeout: 260 seconds]
sloanr has quit [Remote host closed the connection]
varjagg has quit [Ping timeout: 248 seconds]
<nij-> Cool site. What is it about? Appendix to CLTL2?
NotThatRPG has quit [Ping timeout: 268 seconds]
<pdietz> It's usually a bad idea to use eq.   Use eql instead.
<phoe> nij-: blogsite of one of ANSI CL authors
<pdietz> aeth: specialized methods for simple-strings of various known character classes would also be useful.
<pdietz> And beyond that, a compiler macro for optimizing special cases, like comparing against constant strings.
<nij-> ANSI CL is another thing?
<nij-> Wait. Lemme see.
Lycurgus has quit [Quit: Exeunt https://tinyurl.com/4m8d4kd5]
Inline has quit [Remote host closed the connection]
Inline has joined #commonlisp
attila_lendvai has joined #commonlisp
<phoe> ANSI CL is the current revision of the Common Lisp standard
Oladon has joined #commonlisp
attila_lendvai has quit [Remote host closed the connection]
attila_lendvai has joined #commonlisp
shka has quit [Ping timeout: 252 seconds]
<nij-> I see.
NotThatRPG has joined #commonlisp
jolby has quit [Quit: Client closed]
rgherdt has quit [Remote host closed the connection]
morganw has quit [Remote host closed the connection]
akoana has joined #commonlisp
cognemo has quit [Ping timeout: 264 seconds]
attila_lendvai_ has joined #commonlisp