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>
random-nick has quit [Ping timeout: 252 seconds]
srhm has quit [Quit: Konversation terminated!]
waleee has quit [Ping timeout: 268 seconds]
recordgroovy has quit [Quit: leaving]
peterhil has quit [Ping timeout: 258 seconds]
cjb has joined #commonlisp
waleee has joined #commonlisp
ldb has joined #commonlisp
<ldb> good morning everyone
yitzi has quit [Quit: Leaving]
nij- has joined #commonlisp
nij- has quit [Client Quit]
tyson2 has quit [Remote host closed the connection]
<phantomics> morning ldb
recordgroovy has joined #commonlisp
lad has quit [Ping timeout: 240 seconds]
dsk has joined #commonlisp
mister_m has joined #commonlisp
mister_m has quit [Remote host closed the connection]
pegaso has quit [Quit: Leaving]
prxq_ has joined #commonlisp
prxq has quit [Ping timeout: 265 seconds]
derelict has quit [Ping timeout: 240 seconds]
<beach> Good morning everyone!
waleee has quit [Ping timeout: 240 seconds]
derelict has joined #commonlisp
makomo has quit [Ping timeout: 256 seconds]
<phantomics> morning beach
lottaquestions has quit [Read error: Connection reset by peer]
lottaquestions has joined #commonlisp
Fare has quit [Remote host closed the connection]
Fare has joined #commonlisp
Josh_2 has quit [Remote host closed the connection]
recordgroovy has quit [Ping timeout: 258 seconds]
notzmv has quit [Ping timeout: 256 seconds]
ldb has quit [Ping timeout: 265 seconds]
derelict has quit [Quit: WeeChat 3.2]
cjb has quit [Ping timeout: 256 seconds]
meraz_1 has joined #commonlisp
notzmv has joined #commonlisp
cjb has joined #commonlisp
<kakuhen> pjb: regarding the macro from yesterday, it seems that restart-case does not place forms on the top level, and the cl spec only guarantees types exist when you defclass on the top level; it seems you can have implementation-specific behavior when you defclass below the top level
<kakuhen> so what we observed in sbcl and ccl is likely not a bug in the compiler
Fare has quit [Remote host closed the connection]
pranavats has joined #commonlisp
Bike has quit [Quit: Lost terminal]
cjb has quit [Quit: rcirc on GNU Emacs 28.0.50]
cjb has joined #commonlisp
trufas has quit [Ping timeout: 265 seconds]
trufas has joined #commonlisp
cjb has quit [Quit: rcirc on GNU Emacs 28.0.50]
recordgroovy has joined #commonlisp
Inline has quit [Quit: Leaving]
rain3 has joined #commonlisp
contrapunctus has joined #commonlisp
zos has quit [Quit: WeeChat 2.8]
contrapunctus has left #commonlisp [#commonlisp]
rain3 has quit [Read error: Connection reset by peer]
rain3 has joined #commonlisp
contrapunctus has joined #commonlisp
cjb has joined #commonlisp
gaqwas has joined #commonlisp
silasfox has quit [Ping timeout: 272 seconds]
silasfox has joined #commonlisp
Qwnavery has joined #commonlisp
meraz_1 has quit [Remote host closed the connection]
hendursaga has quit [Ping timeout: 244 seconds]
hendursaga has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
Lord_of_Life_ is now known as Lord_of_Life
ldb has joined #commonlisp
slyrus_ has quit [Quit: Leaving]
gaqwas has quit [Ping timeout: 252 seconds]
selwyn has joined #commonlisp
pve has joined #commonlisp
ldb has quit [Ping timeout: 268 seconds]
Krystof has joined #commonlisp
ldb has joined #commonlisp
ldb has quit [Ping timeout: 265 seconds]
ldb has joined #commonlisp
dsk has quit [Ping timeout: 256 seconds]
<pjb> kakuhen: indeed.
peterhil has joined #commonlisp
<pjb> kakuhen: note that restart case in foo could have only been invoked by the compiler, since it wraps only defclass and defmethod.
ldb has quit [Ping timeout: 252 seconds]
ldb has joined #commonlisp
ldb has quit [Ping timeout: 240 seconds]
heisig has joined #commonlisp
CrashTestDummy3 has joined #commonlisp
CrashTestDummy2 has quit [Ping timeout: 245 seconds]
hendursa1 has joined #commonlisp
hendursaga has quit [Ping timeout: 244 seconds]
Qwnavery has quit [Quit: WeeChat 3.2]
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
cjb has quit [Quit: rcirc on GNU Emacs 28.0.50]
lotuseater has joined #commonlisp
Qwnavery has joined #commonlisp
Qwnavery has quit [Quit: WeeChat 3.2]
Qwnavery has joined #commonlisp
<lotuseater> Hey does anyone know this Automated Mathematician system by Douglas Lenat? (from which Cycorp more or less evolved)
Qwnavery has quit [Ping timeout: 258 seconds]
<edgar-rft> lotuseater: wasn't that one of the predecessor ideas that later became known under the term "genetic programming" (automatically generating, modifying and testing computer source code)?
<lotuseater> yes could also be
<lotuseater> I read that article some minutes ago
<lotuseater> and first read about this system indirectly in Gödel Escher Bach by Douglas Hofstadter some time ago. to me personally very interesting as it also touches experimental mathematics
<edgar-rft> to me all sort of math appears as "experimental" :-)
<lotuseater> hehe yes indeed. and mostly discovered, like Lisp is discovered
<lotuseater> the great mathematicians like Euler, Gauss, etc were all experimental mathematicians in the first part of their work pipeline
<lotuseater> so I found an archived repo of AM translated from Lisp to Prolog but the file organization seems messy
<lotuseater> ah okay I take that back
<hayley> That'd check out for the author.
<lotuseater> he also has a repo with Arc ^^ a forked dialect named anarki
<hayley> He is a total hack-job.
<lotuseater> explain what you mean plz :)
makomo has joined #commonlisp
<hayley> Anyways, AM looks like an interesting project. In the context of CL programs, I considered a program which would just nudge things around to find dumb mistakes that I fail to find because I'm not thinking about them.
<lotuseater> hmm
<hayley> Well, his shtick is that abstraction is a net loss would you flip through lots of codebases, or would you be a new programmer. But as Dijkstra said (paraphrasing) "the aim of abstraction is to make a layer that one can be totally precise about."
<lotuseater> oh yes
attila_lendvai has joined #commonlisp
<lotuseater> and I read a very funny post on hackernews from one ex-employee of Cycorp :D
<hayley> Without such a mechanism, one achieves a vulgar kind of simplicity where they can't do very much, even if the components are blatantly obvious in what they do. It's like less-is-less rather than less-is-more.
<lotuseater> okay i see
<hayley> Should I shut up now? I could go on for a long time about how annoying it is that such a bad idea of "simplicity" permeates the minds of a lot of hackers.
<lotuseater> no it's okay for me, but could be seen as too offtopic
<hayley> Definitely. (Or we take it to #lispcafe? :)
<lotuseater> okay good idea
<hayley> Still, only if you want to be on the receiving end of it.
<lotuseater> of course everytime I learn so much from you people
peterhil has quit [Read error: Connection reset by peer]
peterhil has joined #commonlisp
edgar-rft has quit [Remote host closed the connection]
edgar-rft has joined #commonlisp
tfeb has joined #commonlisp
tfeb has quit [Client Quit]
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
kevingal has joined #commonlisp
heisig has quit [Ping timeout: 256 seconds]
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
thonkpod has quit [Ping timeout: 240 seconds]
Mrtn[m] has quit [Quit: Bridge terminating on SIGTERM]
loke[m] has quit [Quit: Bridge terminating on SIGTERM]
dieggsy has quit [Quit: Bridge terminating on SIGTERM]
hayley has quit [Quit: Bridge terminating on SIGTERM]
etimmons has quit [Quit: Bridge terminating on SIGTERM]
Gnuxie has quit [Quit: Bridge terminating on SIGTERM]
luis` has quit [Quit: Bridge terminating on SIGTERM]
katco has quit [Quit: Bridge terminating on SIGTERM]
JooTvora[m] has quit [Quit: Bridge terminating on SIGTERM]
happy-dude has quit [Quit: Bridge terminating on SIGTERM]
Guest45 has joined #commonlisp
Guest356 has quit [Remote host closed the connection]
Guest45 has quit [Client Quit]
loke[m] has joined #commonlisp
peterhil has quit [Ping timeout: 258 seconds]
Gnuxie has joined #commonlisp
katco has joined #commonlisp
dieggsy has joined #commonlisp
hayley has joined #commonlisp
etimmons has joined #commonlisp
luis` has joined #commonlisp
Mrtn[m] has joined #commonlisp
happy-dude has joined #commonlisp
JooTvora[m] has joined #commonlisp
<jmercouris> better way than format for concatenating a list of strings into a single string?
thonkpod has joined #commonlisp
<jmercouris> aka (format nil "~{~a ~}" (list "salmon" "are" "great"))
<jmercouris> I COULD do an apply or something on concatenate
<jmercouris> but is that better?
<jmercouris> am I overthinking a trivial operation?
<edgar-rft> (apply #'concatenate 'string (list "a" "b" "c")) = "abc"
<luis> not a great idea if the list has an arbitrary number of elements, though.
frgo has quit [Remote host closed the connection]
hafat has joined #commonlisp
frgo has joined #commonlisp
<hayley> Your FORMAT string would also include spaces, for what it's worth.
<jmercouris> yes, sure, I could remove the spaces no problem
<jmercouris> I'm not asking about trivial semantics
<luis> jmercouris: something like serapeum:string-join is probably slightly nicer
<jmercouris> I'm asking if there is a performance penalty or reason to prefer one or the other
<jmercouris> luis: that may very well be a good idea, thanks
<luis> jmercouris: from a readability standpoint that is. I have no idea about performance.
<jmercouris> yes, agreed
<jmercouris> serapeum may be faster because it looks to be using streams
attila_lendvai has quit [Read error: Connection reset by peer]
<hayley> Well, you know the size of the output string already, so you can allocate exactly the right size and fill it in.
attila_lendvai has joined #commonlisp
<hayley> c.f. fast-io being quite fast. I remember I wrote a faster-io as I knew I could get away with not copying some buffers, so I just stuck those into the list rather than copy them in.
<White_Flame> (with-output-to-string (*standard-output*) (mapc #'write '(1 2 3)))
shka has joined #commonlisp
<hayley> How much are you concatenating though? Depending on the context you probably shouldn't care too much.
random-nick has joined #commonlisp
<jmercouris> quite a bit... depending
<jmercouris> it is with regards to documents on the internet
<jmercouris> so the amount of concatenation varies
yitzi has joined #commonlisp
treflip has joined #commonlisp
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
<pjb> lotuseater: nothing new about CyC. I dug a little into OpenCyC some years ago, and indeed, everything that's said was apparent. The best thing they could do to unlock the situation would be to replace the pseudo-lisp->java translator by a pure CL implementation, then externalize the database (so it can be put in git). Then things could evolve…
<pjb> If I had the resources ,I would have done that with OpenCyc.
<pjb> jmercouris: (com.informatimago.common-lisp.cesarum.sequence:concatenate-sequences '(vector character) '("Foo" "Bar" "Baz")) #| --> "FooBarBaz" |#
kakuhen has quit [Quit: Leaving...]
<pjb> jmercouris: there's also: (com.informatimago.common-lisp.cesarum.string:concatenate-strings '(("FooBar" 0 3) (#\b #\a #\z) (quux 2 4))) #| --> "FoobazUX" |#
<jmercouris> Yes
<etimmons> Xach: I was over optimistic on UIOP release timeline. I don't think it'll make it for this next QL. Maybe the random failures experienced by users will cause at least a few more folks to explicitly depend on UIOP if they use anything from it
d4ryus has joined #commonlisp
yitzi_ has joined #commonlisp
yitzi has quit [Ping timeout: 250 seconds]
hafat has quit [Ping timeout: 256 seconds]
yitzi_ has quit [Remote host closed the connection]
yitzi has joined #commonlisp
Bike has joined #commonlisp
<jmercouris> (format nil "~{~a~}" some-list) -> (xyz . qre)
<jmercouris> I want to print just the car
<jmercouris> I did try:
heisig has joined #commonlisp
<jmercouris> (format nil "~{~/car ~a/~}" some-list)
<jmercouris> but it seems I don't understand how to use the ~/ / directive because it complains that I am trying to pass 4 arguments to car
prxq_ is now known as prxq
<Bike> it's ~/function-name/, and the function has to take a particular argument convention so it can have commas and colons like other directives
<Bike> clhs ~/
<Bike> i don't think there's any easy way to get format to print the cars of a list (without doing like (mapcar #'car ...) i mean obviously)
<Bike> maybe there's some junk with ~{}, but i don't know if that works with dotted lists
<jackdaniel> how about (format nil "~:{~a~}" '((a . b) (c . d)))
<jmercouris> Bike: I did end up with mapcar...
tyson2 has joined #commonlisp
<jmercouris> jackdaniel: what is ~: ?
<jackdaniel> when you navigate to the part of the spec that describes tilde left brace you will find out
frgo has quit [Ping timeout: 252 seconds]
<jmercouris> It seems to be a modifier for the tilde brace
<jmercouris> I've not been able to find that part of the spec
<jmercouris> I usually rely on the PCL book to learn about format
<jmercouris> I can't ever remember how to get to the damn directives
<Bike> you can also do
<Bike> clhs ~{
<jmercouris> I will do that, thanks
<jmercouris> maybe I'll add l1sp to my search engines
ldb has joined #commonlisp
<ldb> find a interesting book about book composition using moveble type that mentioned how to typeset music scores
<ldb> it is hard to find books like this these days
<beach> ldb: The main reference for music engraving rules is "Behind Bars".
<beach> It is quite recent.
<beach> There was only one book before that, namely that of Ross, but it was a lot less complete than Behind Bars.
<ldb> beach: oh, you told me Behind Bars before. that is a very comprehensive book
<beach> Yes, it is very good.
makomo has quit [Ping timeout: 265 seconds]
<ldb> The book I found is Modern Methods of Book Composition
<beach> Oh, that sounds more like it's about technology rather than design rules.
<ldb> That book describes how the staff is composed by many lines and elements, with movable type. I guess today with digital typesetting capable of doing overlapping, such a system would rarely been used.
<beach> I see.
Lycurgus has joined #commonlisp
makomo has joined #commonlisp
nij- has joined #commonlisp
<nij-> Hi! I constantly run into situations where pattern matching is needed. Most of the time, I can get through it by writing adhoc looking codes.. but I think there must be a better way. So here's an example: how would you write pattern matching code for #'fun such that it groups a list of lists based on the cars?
<nij-> (fun '((1 a b) (2 c d e) (3 f g) (1 h i j) (2 k))) ;; => ((1 a b h i j) (2 c d e k) (3 f g))
<nij-> I've looked into the package trivia, but couldn't figure it out. Here's my attempt:
<hayley> I think the meat of such a function is mostly not pattern matching logic.
<jmercouris> grouping a list of list based on the cars, sounds like a job for a H A S H T A B L E
<heisig> nij-: I recommend Trivia for pattern matching. But what you describe isn't a pattern matching problem.
<nij-> Yeah, the function itself isn't not about pattern matching logic. But I think my code can be much cleaner if written in the PM style.
<ldb> I guess you need a multiset, maybe hastable
<jmercouris> that's just my O P I N I O N
<nij-> jmercouris: R E S P E C T : )
<jmercouris> :-D
<nij-> no no.. the issue isn't how to implement #'fun.... but to implement it using a clean PM code.
<ldb> cleaner? I don't think writing imperative code is bad in CL
<hayley> That pattern rather matches positions, not elements with the same heads, as heisig said.
<ldb> CAR, CADR, CADDR ...
<hayley> Even plain LOOP destructuring would be fine.
<nij-> ldb: not bad - I'm just wondering how to do it in another way in PM :)
<nij-> I can just run loops over it and collect things I want. That's fine.
<nij-> But I'd really hope I can expand my horizon too.
<hayley> (loop for (key . values) in list do (stash-values key values) finally (return accumulated-values))
<nij-> hayley: How would you use loop destructuring? I think that's some thing I haven't considered.
<nij-> oh hm lemme see.
<jmercouris> Loop is really magic
<hayley> One good pattern matching problem would be a symbolic derivative function, or a term simplification function.
<ldb> yes loop can destructuring, there are also variants to LET that can do destruct, probably described in Let over lambda
peterhil has joined #commonlisp
<hayley> The DEFINE-RE macro I used for simplifying regular expressions even got some appraisal from one die-hard functional programmer. That would be where you want pattern matching.
Inline has joined #commonlisp
<nij-> I'm thinking about the possibility of turning regex's (for text) functionalities into lisp (for sexprs)..
<nij-> But I need to come up with a harder problem, which couldn't be easily solved by desstructuring LOOP.
<nij-> I will be back ;)
<hayley> You want to parse the textual form of a RE? Or you want a RE which matches Lisp objects?
<nij-> The latter.
<nij-> A RE-like DSL that matches Lisp objects.
frgo has joined #commonlisp
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #commonlisp
frgo has quit [Ping timeout: 256 seconds]
<pjb> nij-: we cannot say what is required, because you've not written down any specification / requirements for your function. Only an example of call. If it's an exercise in learning list processing (car/cdr/cons), then no matching is needed. It's clear from your example, that we only test the first element of each sublist, by the way it's even of a different type!
<pjb> or indeed, destructuring-bind or in simple cases, loop destructuring.
<nij-> pjb I get your point. I will come back with a few stronger examples.
<pjb> nij-: some pattern matchers are actually regexp engines. (but often not, since you want to have unification, which is out of the scope of normal regexp engines).
<pjb> nij-: some regexp engines are more generic than text processing (the theory is not restricted to text).
<nij-> What do you mean by unification?
<pjb> a pattern may contain variables. if the pattern is repeated, the variable must bind to the same values in all occurences.
<nij-> Oh! I thought regexp is all about text. Do you mind pointing me to some things to read more about non-text regexps?
<pjb> (* (foo ?a) (bar ?a) *) matches ((foo 42) (bar 33) #|>|# (foo 22) (bar 22) #|<|# (foo 33)) with ?a = 22
<pjb> nij-: just any 'theorical' book about regexps.
<pjb> they just talk of symbols and states and transitions and DFA/NFA.
<pjb> nij-: and cl-ppcre is not far from providing the feature IIRC.
<Bike> regexes can work on sequences that arne't full of characters just as well. fundamentals like the kleene star (*) is insensitive to what the sequence actually contains
<Bike> not much more to talk about i don't think
waleee has joined #commonlisp
<nij-> I see. It indeed should be extended to sequences. How about general structs?
<_death> could do worse than read the latest from Sussman (Software Design for Flexibility).. it shows how to implement a bunch of pattern matchers
<_death> including graph matching
<pjb> Well, you'd have to patch it to remove type checks: (handler-case (scan '(:greedy-repetition 2 6 #\b) #(33 #\b #\b #\c 42)) (error (err) (princ err))) --> The value 33 is not of the expected type character.
<pjb> But notice how the regexp is not a string.
<pjb> Note: (scan '(:greedy-repetition 2 6 #\b) #(#\b #\b #\b #\c #\a)) #| --> 0 ; 3 ; #() ; #() |#
<pjb> no string.
tfeb has joined #commonlisp
<Bike> what do you mean by general structs?
<pjb> People always put too many type checks in their programs! Silly!
<Bike> ooh, graph matching
<nij-> Bike - say I want to collect every thing that's a struct that has a slot :SLOT whose value is 0.
<pjb> for graph you'd need a little more complexity (you'd have to walk the different branches, and avoid duplicate subpaths), but dealing with acyclic structures (trees) is done routinely in pattern matchers.
<pjb> it's only a matter of having primitive matchers for all your data types.
<Bike> are you talking about pattern matching? Because that doesn't really seem related to regular expressions to me, unless i'm missing something
<nij-> (I can use loop, yes.. but that seems a bit adhoc - I dunno..)
ldb has quit [Ping timeout: 250 seconds]
<_death> many Lisp books contain sections about implementing pattern matchers.. usually showing naive interpreter-like matchers and then moving on to compilation.. if you have a lot of patterns (or "rules") you can read about more advanced stuff like the RETE algorithm
ldb has joined #commonlisp
<nij-> (match *x* ((struct :a 0 :b y)) y)
<nij-> By pattern matching general structs I mean something like this ^
<nij-> Namely, if *x* is a struct whose :a contains 0, then extract it's value from the :b slot.
<Bike> seems doable to me, though you might need mop support. i don't know if trivia has it built in though.
<nij-> Yeah.. and the DSL this should be recursive. For example,
<nij-> (match *x* ((struct :a (list 0 1 __ 3) :b y)) y)
<nij-> here, (list 0 1 __ 3) means any list that starts with 0 and 1, has 0 or more stuff in between, but ends with 3.
<Bike> actually, this seems to be an example in trivia's documentation
<Bike> so there you go
<Bike> (the foo struct)
<_death> I think pattern matchers (and unifiers) can be useful when the patterns are "data", i.e. not set in stone.. they are a nuisance in ordinary code, in my opinion.. so I don't like Haskell/Prolog/Erlang/etc. ordinary use of it
<tfeb> you can't do that portably unless by 'struct' you really mean 'name of a class' (which seems to be what the trivia exam0le has)
<nij-> Yeah, I really meant any struct that has slot :a being 0.
<nij-> This seems like a hard DSL design problem. The question isn't how to extend trivia for it to do that.
<tfeb> nij-: and that's what you can't do.
<nij-> But rather, how to design a general DSL that cover all cases.
<tfeb> in portable CL
<Bike> you don't need to extend trivia, it's built in. trivia has a DSL like this for you.
selwyn has quit [Read error: Connection reset by peer]
<Bike> maybe i don't understand what you mean though.
<tfeb> as you need to introspect on the class of the struct to know if it has such a slot
<tfeb> s/slot/field
<Bike> yeah, but everyone supports mop at least to that extent, so that's not a big deal.
<nij-> Bike, the example in its wiki only matches any struct of type 'FOO.
<nij-> But I want to match any struct that has a 0 in its :a slot.
<Bike> Oh, you want it to work for an instance of any class, as long as it has a slot of that name?
<Bike> That's probably also doable, but it couldn't be very fast
<Bike> "does this object have this slot" is slow
<nij-> Yes, I mean, almost every thing is doable with macros.
<nij-> So the problem really is how to design a general enough DSL, or - has there been one already?
<tfeb> it's also really smelly: my struct has an a field, so does yours, but they mean completely different things
<Bike> i'm pretty sure you could extend trivia's DSL to do this pretty easily
<Bike> You said you don't want to just extend trivia, but I don't understand why
<_death> that's just graph matching.. you just need to follow the links in different ways
<Bike> The actual syntax for the DSL is pretty trivial, something like (ducktyped :a 0 :b y). there's the language design done, now it's just implementation
<Bike> (although you might want to do like trivia and use slot names and accessors, rather than initargs)
Lycurgus has quit [Quit: Exeunt]
<Bike> also i just remembered you wouldn't need MOP if you used slot names, since you can use slot-exists-p
<_death> an old frame system called Parmenides also had a rule engine written for it, FRulekit.. it allowed some pattern matching in its rules (and implemented the rete algorithm).. with some effort, one could probably beat it into CLOS submission instead.. https://github.com/death/Parmenides/blob/master/FRulekit.md
cage has joined #commonlisp
tfeb has quit [Quit: died]
dlowe has joined #commonlisp
selwyn has joined #commonlisp
Josh_2 has joined #commonlisp
selwyn has quit [Remote host closed the connection]
selwyn has joined #commonlisp
<Josh_2> Ello
<dlowe> oi
selwyn has quit [Read error: Connection reset by peer]
selwyn has joined #commonlisp
lisp123__ has quit [Remote host closed the connection]
selwyn has quit [Remote host closed the connection]
dlowe has quit [Remote host closed the connection]
lisp123_ has joined #commonlisp
lisp123_ has quit [Ping timeout: 240 seconds]
zacts has joined #commonlisp
Vultyre_ is now known as Vultyre
mister_m has joined #commonlisp
peterhil has quit [Ping timeout: 258 seconds]
<ldb> lol
dlowe has joined #commonlisp
<lotuseater> pjb: what is that OpenCyc capable of?
<lotuseater> jmercouris: for when i want to concatenate strings and chars i use uiop:strcat
<lotuseater> or look at the STR system
peterhil has joined #commonlisp
dlowe has quit [Remote host closed the connection]
nij- has quit [Quit: Using Circe, the loveliest of all IRC clients]
peterhil has quit [Ping timeout: 256 seconds]
hafat has joined #commonlisp
heisig has quit [Quit: Leaving]
lisp123_ has joined #commonlisp
selwyn has joined #commonlisp
danielam has joined #commonlisp
danielam has quit [Quit: leaving]
JoshYoshi has joined #commonlisp
JoshYoshi has quit [Remote host closed the connection]
JoshYoshi has joined #commonlisp
JoshYoshi has quit [Remote host closed the connection]
tfeb has joined #commonlisp
JoshYoshi has joined #commonlisp
Josh_2 has quit [Ping timeout: 265 seconds]
JoshYoshi has quit [Client Quit]
Josh_2 has joined #commonlisp
hafat has quit [Quit: Leaving]
ldb has quit [Quit: ERC (IRC client for Emacs 27.2)]
lisp123_ has quit [Ping timeout: 245 seconds]
lad has joined #commonlisp
mister_m has quit [Remote host closed the connection]
zacts has quit [Quit: Client closed]
Josh_2 has quit [Quit: ERC (IRC client for Emacs 27.1)]
Josh_2 has joined #commonlisp
tfeb has quit [Quit: died]
zacts has joined #commonlisp
zos has joined #commonlisp
selwyn has quit [Read error: Connection reset by peer]
<pjb> lotuseater: well, it's said in the AMA, it's basically a subset of CyC, notably for the ontologies.
<pjb> lotuseater: but what's interesting anyways, is that people who've spent time inside CyC say that the best option would be to rewrite it from scratch.
<pjb> the ontologies shouldn't be developped manually. They should be infered with statistical ML applied on the web and youtube, and if you have access to robots, from robot action/sensors feedbacks.
<pjb> The brain has clearly several layers, including ANN layers and symbolic layers. And furthermore, there are different kinds of learning. You can learn the table of multiplication (purely symbolic), and once you've learned it, it's "hardwired" into an ANN. And it can even generalize to multiple digit numbers.
<pjb> And you can learn to walk, to talk or drive a bicycle, totally ANN ML, but with SOM and other class of ANN to raise symbolic (conscious) signals and command pathways.
<pjb> And Douglas Hofstadter https://en.wikipedia.org/wiki/Category:Books_by_Douglas_Hofstadter should be studied and followed.
<pjb> That said, CyC Inc is doing something right: exploiting commercially the classical AI algorithms. More companies should do that too, in addition to statistical AI.
attila_lendvai has quit [Ping timeout: 256 seconds]
lisp123_ has joined #commonlisp
* phoe decides to gamble a bit
<phoe> I want to talk a little about code style and naming conventions in Common Lisp Recipes 2
<phoe> and I want to do that without starting a war
<lotuseater> pjb: oh yes i can imagine
<lotuseater> afaik Cyc wants to be "more" than just normal inference engine, for putting in much details that are also situation dependent into it
<lotuseater> "when there's one part of the rubik's cube at this position, none else can be there at the same time"
<lotuseater> so for us humans much of this "obvious" stuff we learn by experiencing when growing up
<lotuseater> phoe: oh there will be a 2nd book?
<phoe> lotuseater: a second edition
<lotuseater> ah I see. is Edi Weitz also involved?
<Josh_2> the first edition is huuuuge
<phoe> nope
<phoe> Josh_2: well the second one will put on a bit of weight too
<lotuseater> hm I think it covers many topics and that's good
<Josh_2> I have a physical copy of the first to my left right now :P
<lotuseater> I should buy that one day too.
<Josh_2> yes its very good
derelict has joined #commonlisp
<lotuseater> learned much from it
<lotuseater> and have to study some parts more eager again
<Josh_2> For me it has only been a reference
<lotuseater> of course usable as such
<lotuseater> phoe: so what are your points?
<phoe> lotuseater: points?
<ck_> about code style and naming conventions
<lotuseater> you said about coding style
<phoe> oh, those
<lotuseater> conventions are good as long as they're reasonable
waleee has quit [Ping timeout: 240 seconds]
<phoe> the first and most important one is that there's no silver bullet for that, given the variety of coding styles and naming conventions that are around
<lotuseater> eg I prefer writing the keywords in LOOP as real keywords
<phoe> the mostly established ones are *foo* for dynavars and +foo+ for constants
<lotuseater> yes of course
<Josh_2> same lotuseater
<lotuseater> I also once read to use %foo% for symbol-macros
<Josh_2> a convention I copied from pjb
<phoe> the less established ones are %foo% for global symbol macros and =foo= or -foo- for global static variables
<Bike> static? you mean like defglobal?
<lotuseater> Josh_2: let alone the syntax highlighting, baggers brought me to this in one of his awesome videos
<phoe> Bike: yes, static as in non-dynamic as in not special
zacts has quit [Ping timeout: 246 seconds]
<lotuseater> ah static variables is one of those points i have still to dig in, but i would use =foo= cause hyphens are mostly for multiple word symbols in between
<Bike> i see
<lotuseater> as long as one has no readmacro chars defined with those
<phoe> lotuseater: that's my sentiment as well, #\- already serves as a separator in Lisp
kevingal has quit [Remote host closed the connection]
<lotuseater> so we come together with this :)
<_death> phoe: +foo+ is less established than *foo*.. e.g., CL symbols don't use it
<phoe> _death: yes
<phoe> ;; +nil+ and +t+ would look absolutely weird though
<phoe> but still, enough code uses +foo+ to make it mentionworthy, even if the CL package does not use it for +pi+ and such
<lotuseater> yes they would. cl21 uses +pi+
<lotuseater> or rather using the real math symbol
<phoe> oooh, unicode
<lotuseater> I know, hairy topic
<phoe> both enticing and scary
tfeb has joined #commonlisp
<lotuseater> but can be expressive
<lotuseater> "the LispWorks terminal repl does not support unicode"
<phoe> you never can have enough expressiveness in Common Lisp™
<lotuseater> hehe
<lisp123_> phoe: you have big shoes to fill. But I look forward to reading it
<_death> my hope is that the number of footnotes is dramatically reduced..
<lotuseater> other people find me weird when i told them "no for the meter per second function i simply use M/S and for the this lexical value i do (let ((5*10^5 (* 5 (expt 10 5)))) ...)
<lisp123_> w.r.t to code conventions, its been something on my mind lately: the latest I have got to is that "lisp 2" way of doing things IMHO is very good. I name _all_ my variables the same name as the function that generates them. And then the parameters / arguments are also following the consistent naming, unless it makes it too, too long
<lotuseater> "but the left is the computation!" eh no
<_death> lotuseater: maybe there's a better name than 5*10^5
zacts has joined #commonlisp
<lotuseater> no i found it for me very reasonable and it was jsut for me
<_death> lotuseater: for the computation I'd likely just write 5e5 (but that would be a float)
<lisp123_> here is an example: https://pastebin.com/g3KKGt0U
<phoe> lisp123_: I'm aware, it's kinda scary
<lotuseater> yes and I needed this and others as integers :)
aidenw has joined #commonlisp
<phoe> _death: actually I don't have good news for you - I have no idea how to approach this problem, especially since footnotes are a matter of taste as well
<lotuseater> lisp123_: ah that is what you mean
<phoe> but that's already a publishing kind of problem, and maybe #clcs will be a better venue to discuss this
<lisp123_> lotuseater: what do you think :) I think its kinda done already (everytime one does (let ((list (list 1 2 3 )... for example
<phoe> lisp123_: the first and most important goal is not to screw up what the first edition already achieved, and that's already a tough thing to do given how consistent CLR is as a book
<phoe> all the cross-references and such
<lotuseater> yes I'm totally into that
<_death> phoe: whenever there was a footnote, I felt compelled to read it, and then, disappointed, "why not just say what mean in the main text, clearly and succinctly?".. I could not bear to read the book to the end..
<lotuseater> _death: here a better version 5×10⁵ :D
<_death> lotuseater: I don't think unicode belongs in source code
<lisp123_> phoe: also it has quite a unique style. you can pick up any chapter of CLR, and quickly apply the examples to produce useful code. Good luck :) (would be great to give extended treatment of BKNR since that's one of my favourite packages lol, just throwing that in there)
<lotuseater> yes and no
selwyn has joined #commonlisp
<phoe> lisp123_: yes, this is the idea - each recipe is meant to be fully independent on its own, and link everywhere else in the book for off-topic things
<lisp123_> _death: don't say that, I use unicode extensively (for symbolic computation its a godsend) :O
<_death> lotuseater: and for names like "alpha" etc. often a better name is, say, "learning-rate".. though often programmers deal with their mathematician jealousy by taking the bad habits, I know
<phoe> _death: it's a good thing that phantomics doesn't seem to be around at the moment :D
<lotuseater> yes of course, expressiveness by naming for remembering
<lotuseater> or in C code: int lr = 0.5;
<phantomics> haha I might have a problem with excluding unicode...
<lotuseater> and of course with no comment, so it's "obvious" lr means learning-rate in this context
<lisp123_> phantomics: what programs do you build with unicode? math software? (I'm doing that)
<lotuseater> phantomics: so April evolves then to JCL :D
<tfeb> they're not bad habits: for a lsnguage (maths) designed to be handwritten, brevity matters a lot.
<lotuseater> lisp123_: oh you would like April
<_death> that said I do sometimes use greek letter names.. if there's a docstring explaining or it's deeply ingrained in the nomenclature of the subject matter then it's ok, I guess
<phantomics> I write APL using unicode, also my APL compiler generates Lisp code that includes unicode
<phoe> _death: and as for footnotes, I have no idea if I can solve it
<ck_> Julia code is very fond of using single-character unicode names for a lot of things
<phoe> especially regarding the fact that I'm sort of a footnote/Tufte-style sidenote person myself
<phantomics> For example: APRIL-WORKSPACE-GRAPH-DEMO-SPACE-LEX::|𝕆𝕃∇cjoin|
<phoe> oh goodness
<phantomics> And 𝕊|a|
<lotuseater> tfeb: and also matters MUCH having it good readable in handwritten sheets or typeset papers. "is this index i or j?" "is this a zeta or xi?"
<lisp123_> lotuseater: Noice, starred and forked :D
<lotuseater> lisp123_: when you wanna learn APL phantomics also advised me to the Dyalog Tutor or for use to learn April his long talk on YT
<lotuseater> phoe: see it as another world/use-case
<phantomics> The 𝕊 appears in front of most variables in compiled April, it's a reader macro that expands to a form that gets transformed by a macro to intern symbols in the proper workspace package
<lotuseater> damn i hate that bug with the door bell
<phantomics> The Dyalog tutorial is here: tutorial.dyalog.com/
<lisp123_> lotuseater & phantomics - thanks <3
<lotuseater> or from another point of view, in another reality the normal ASCII set could differ. it's like seeing complex numbers not the same as reals, they're just being different operated on but both types are of same "reality"
<tfeb> lotuseater: I'm not sure what you're trying to say. written maths is essentially a natural language,and it works pretty well. long names for things would make it radically harder to write, and in in fact read (no-one wants some equation which is already split over three lines to require two pages). (FWIW I write and read more maths than
<tfeb> programs)
<phantomics> Enjoy, lisp123_, let me know if you have questions
<lotuseater> wasn't so important
<_death> tfeb: right, I should've been more careful with that remark.. it's a bad habit when you wear the programmer hat.. I do sometimes use the character names when I implement something from a paper.. but often regret it later on if I didn't document what the actual meaning is
<lotuseater> so it's best coming together and finding local optima
<phantomics> I always found traditional math notation to be awful, there's no consistency, just a bunch of discordant standards for different things stuck together
<_death> tfeb: even in a math paper, there is a balance between greek salad and concise math.. for that I often find papers before say 2000 much clearer than papers written after, at least in the subjects I'm interested in
<tfeb> phantomics: exactly. It's a natural language (or a bunch of related ones) and just like English it's an insane mess. Programming languages should not be like mayhs
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
<lisp123_> phantomics: thanks, will do
<tfeb> _death: agree, it should be written to be readable
<tfeb> To change subject ... does anyone (know anyone who)
<phantomics> APL strikes a good balance for a programming language that also functions as mathematical notation, I'd rather read math concepts presented in Iverson notation than traditional notation
<tfeb> ack ... does anyone know people who use series in anger?
<tfeb> (As in, Richard Waters' series)
<_death> I remember Joe Marshal writing about use of series in c.l.l
<phantomics> I've wanted to try it for a while but (loop) seems to cover what I need for now
<phantomics> Although (loop) is annoyingly unlispy
waleee has joined #commonlisp
<lotuseater> i hope in SICL the LOOP macro or FORMAT get extensible
<tfeb> And also, if anyone knows a mail address for Raymond Toy could they either let me know it (not in the channel) or ask me for mine (likewise) and ask him to contact me about series
<_death> maybe the commit log for the series repo
<tfeb> latter option is perhaps safer
zagura has quit [Quit: Reconnecting]
zagura has joined #commonlisp
<tfeb> _death: yes, I've mailed that address but last commit was 2013, not sure it is current
<tfeb> reason forasking is that I'm trying to make it more installable and don't want to treadon toes
* tfeb seriously hates on-screen tablet keyboards
<_death> do you mean in the sense of (series::install)
<_death> I also wrote some patch for series last year that you may find interesting, though I've not used series in anger :) https://gist.github.com/death/cec04d179e607657f409364442bf2a04
<tfeb> _death: thanks
<tfeb> now I will lose thisand have to ask again in a week
<tfeb> _death: yes, but also the ASDF packaging is hugely old, the tests are hard to run
jans has joined #commonlisp
<tfeb> and in due course I'd like maybe to remember enough of it (my name is in the commit logs frrom about 1995...) to maybe make real improvements especially for modern implrmentations
<_death> maybe also move from sourceforge ;)
<tfeb> ehem, that too
<tfeb> But I've spent enough of my life pissing other people off that I want to make sure Idon't this time
<tfeb> and rtoy clearly put lots of work into it
<yitzi> tfeb: rtoy also works on CMUCL and Maxima. He maybe around those repos/mailing lists.
zacts has quit [Quit: Client closed]
<Josh_2> phantomics: loop is very lispy in spirit :P
<Josh_2> It embodies the spirit on Lisp thats for sure
<Josh_2> of lisp*
<phoe> Josh_2: you mean that people are constantly arguing over it?
* phoe ducks
<Josh_2> XD
tfb has joined #commonlisp
<tfeb> yitzi: thanks, I will look there
nature has joined #commonlisp
* tfeb carefully avoids making comment about loop
<tfeb> I have to go, but if anyone has pointers for series people send a message to tfb, who is me.
tfeb has quit [Quit: died]
<Josh_2> Is there a functioning youtube api library about?
<Josh_2> I see one but it say sversion 0.2.1 2007-03-22
<lotuseater> in python for sure :D
<Josh_2> yeh nah
<Josh_2> I would need to integrate it into my bot which is all written in CL :P
<phoe> burgle some batteries
<Josh_2> I'd be better off just making the API
<Josh_2> making the library
<Josh_2> Writing libraries for API's isn't very hard so shouldn't be a problem
tyson2 has joined #commonlisp
CrashTestDummy2 has joined #commonlisp
CrashTestDummy3 has quit [Ping timeout: 258 seconds]
aidenw has quit [Remote host closed the connection]
aidenw has joined #commonlisp
hafat has joined #commonlisp
hafat has quit [Quit: Leaving]
hafat has joined #commonlisp
hafat has left #commonlisp [#commonlisp]
hafat has joined #commonlisp
hafat has left #commonlisp [#commonlisp]
hafat has joined #commonlisp
waleee has quit [Quit: WeeChat 3.2]
waleee has joined #commonlisp
voidengineer has joined #commonlisp
srhm has joined #commonlisp
treflip has quit [Remote host closed the connection]
rain3 has quit [Ping timeout: 256 seconds]
aidenw has quit [Remote host closed the connection]
dsk has joined #commonlisp
zacts has joined #commonlisp
voidengineer has quit [Quit: Leaving]
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
lisp123_ has quit [Remote host closed the connection]
lisp123_ has joined #commonlisp
silasfox has quit [Ping timeout: 240 seconds]
lisp123_ has quit [Ping timeout: 268 seconds]
zos has quit [Quit: WeeChat 2.8]
<Josh_2> Combining spinneret with the progn method combination is great :D
Guest82 has joined #commonlisp
akoana has joined #commonlisp
<Guest82> Hi, sorry for the incredibly late reply (I've had a crazy time in my life lately...) but: Josh_2 contrapunctus shka loke[m] etimmons and beach thank you so much for answering me! on the questions I asked on July 4th! :D Thanks for pointing out at the commercial uses of lisp for web apps and the help dealing with some issue. Cheers!
<phoe> Guest82: no worries, a ping value of three and half a week is still tolerable on IRC
lisp123_ has joined #commonlisp
<Guest82> thanks :D
Guest82 has quit [Quit: Client closed]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
Guest82 has joined #commonlisp
zacts has quit [Ping timeout: 246 seconds]
Guest82 has quit [Client Quit]
selwyn has quit [Read error: Connection reset by peer]
lisp123_ has quit [Ping timeout: 250 seconds]
<pl> Maybe worth job change I'll have the time to write some libs for a very commercial lisp use XD
<pl> In a world where vendor-locked IDEs are accepted, SBCL doesn't look that unique ;-)
<shka> pl: that's cool
silasfox has joined #commonlisp
<phantomics> Guest82: what were those commercial uses? Interested to see...
Guest82 has joined #commonlisp
<phantomics> since you're back, Guest82: what were those commercial uses? Interested to see...
Guest82 has quit [Client Quit]
shka has quit [Ping timeout: 250 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
kakuhen has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
lisp123_ has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
lisp123_ has quit [Ping timeout: 256 seconds]
gaqwas has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
<phoe> is there a portable way to get a type specifier that matches only something of type X and not its subtypes?
<phoe> something equivalent to EQ CLASS-OF if we were talking classes instead
<phoe> if BAR inherits from FOO, I'd like something that is (AND FOO (NOT BAR)), except obviously I cannot enumerate all subtypes in the NOT because new ones can be created at any time
<_death> satisfies
<phoe> I was worried that would be the answer
pve has quit [Quit: leaving]
<_death> out of curiosity, why do you want to do that?
<phoe> deep-copying structures around
<phoe> and thinking what exactly I want to achieve
<_death> I see
<Bike> i don't understand what exactly this would mean except in relation to classes
<phoe> yes, I'm still thinking
gaqwas has quit [Ping timeout: 265 seconds]
<pjb> phoe: subtypes are usually subsets.
<phoe> yes, I was talking garbage, don't mind me
<pjb> the only case is when you can't insert a type between tyep type and NIL. eg (subtypep 'nil '(integer 42 42)) #| --> t ; t |#
<pjb> For classes, that would be meaningful indeed.
<moon-child> pjb: types are not sets. Your broader point applies however
<pjb> = direct-instances
<pjb> moon-child: more or less, yes.
<_death> what are types if not sets?
<_death> seems like an equivocation
<phoe> I mean, that's a long article
<phoe> is there a tl;dr?
<_death> in Common Lisp, types are sets
<moon-child> actually, since in common lisp types can be defined according to arbitrary predicates
<Bike> yeah, common lisp types wouldn't work for curry howard so well. they define a naive set theory.
<moon-child> types are classes
<moon-child> :^)
<phoe> more like the other way around
<phoe> KEYWORD is not a class even though I wish it was
<_death> I guess you mean "class" in the set theory sense
<moon-child> phoe: I mean, lisp-level types are maths-level classes
<Bike> also, the standard literally defines types to be sets within the context of the language, just to make it clear
<phoe> oh!
<moon-child> _death: yeah
recordgroovy has quit [Ping timeout: 272 seconds]
<phoe> welp
<_death> but they are sets (which are classes)
<Bike> yeah, naive set theory. so things like "barbers that shave only those who do not shave themselves" are sets
<Bike> (satisfies barber-who-shaves-only-those-who-do-not-shave-themselves-p)
<_death> you need to provide the definition of this predicate :)
<phoe> how would you even properly express that in a CL type system
<_death> types are not first class objects in Common Lisp
<Bike> (defun type-that-contains-itself-p (type-specifier) (typep type-specifier type-specifier)) (satisfies type-that-contains-itself-p)
<Bike> for the actual paradox throw some nots in there
<Bike> and then marvel as a math thing from a hundred and twenty years ago leads to the practical consequence of needing to restart your lisp
<phoe> :(
cjb has joined #commonlisp
<Bike> e.g., (typep 'cons '(satisfies type-doesnt-contain-itself-p)) => T, (typep '(cons t) ...) => NIL, (typep '(satisfies type-doesnt-contain-itself-p) '(satisfies type-doesnt-contain-itself-p)) => hang
<Bike> or just a stack overflow i guess. forgot about those
<aeth> SATISFIES is cheating, though
<aeth> since you can just do (loop)
<phoe> typep should be able to return (VALUES NIL NIL)
<moon-child> Bike: yeah, lots of things are easy to express mathematically but not so much in code
<Bike> i'm not talking about how to hang the type system, i'm talking about how types are sets.
<moon-child> see also: y combinator, in eager languages
<Bike> it's easy to express in code! the result just sucks is all
<aeth> hmm, apparently SBCL doesn't like me using FLET with a satisfies type
<Bike> satisfies is literally unrestricted comprehension. the lisp type system is set theory pre-russell.
<Bike> satisfies only works with global function names.
<aeth> (defun loop* (x) (declare (ignore x)) (loop)) (typep 42 '(satisfies loop*))
<_death> Bike: well, wasn't Russell's solution to introduce multiple levels (meta)
<phoe> is there any strictly technological reason why it cannot accept function objects?
<phoe> like `(satisfies ,(lambda (x) (oddp x))
<aeth> for all I know, other implementations do
<Bike> wasn't levels quine? or was everyone doing that?
<Bike> an implementation accepting a function would be nonconforming, and i don't think any of them do
<Bike> i don't think there's a technological reason though.
<phoe> yes, I know
<_death> think everyone was doing that, but not in that context
<phoe> just a question for the Hypothetical Future Revision™
<_death> I especially liked Tarski :)
<Bike> well tarski is the coolest logician.
<phoe> since type specifiers can already be unreadable, adding a function object in there won't break anything
<Bike> or was, i guess he's dead probably.
aidenw has joined #commonlisp
<_death> so the thing is, types are not first class objects.. you can only refer to them via type specifiers
<Bike> more seriously i think any HFT of types would warrant some thought about what types are actually for. i thought about it once and came up with four uses pulling them in different directions, though i don't remember the fourth now
<aeth> four?
<aeth> I can think of only two: types-for-verification and types-for-performance-hints.
<aeth> verification as in precondition/postcondition
<Bike> types are a predication DSL, used to describe constraints to the compiler for optimization, and used to describe storage classes for arrays and structures and stuff.
recordgroovy has joined #commonlisp
random-nick has quit [Ping timeout: 276 seconds]
hafat has quit [Ping timeout: 245 seconds]
yitzi has quit [Quit: Leaving]
hafat has joined #commonlisp
hafat has quit [Client Quit]
hafat has joined #commonlisp