jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | offtopic --> #lispcafe
oni-on-ion has quit [Remote host closed the connection]
mindCrime has joined #lisp
pjb has quit [Ping timeout: 246 seconds]
jnewton` has quit [Ping timeout: 240 seconds]
oni-on-ion has joined #lisp
arduo has quit [Remote host closed the connection]
nij has quit [Quit: #archlinux]
oni-on-ion has quit [Client Quit]
hiroaki has quit [Ping timeout: 260 seconds]
sm2n has quit [Read error: Connection reset by peer]
sm2n has joined #lisp
sm2n has quit [Excess Flood]
sm2n has joined #lisp
CrashTestDummy2 has joined #lisp
patlv_ has joined #lisp
patlv_ has quit [Client Quit]
CrashTestDummy3 has joined #lisp
sm2n_ has joined #lisp
sm2n has quit [Read error: Connection reset by peer]
CrashTestDummy has quit [Ping timeout: 268 seconds]
CrashTestDummy2 has quit [Ping timeout: 240 seconds]
karlosz has joined #lisp
psilotorp has joined #lisp
monolithic has quit [Remote host closed the connection]
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #lisp
long4mud has joined #lisp
sm2n_ has quit [Read error: Connection reset by peer]
sm2n has joined #lisp
Bike has quit [Quit: Lost terminal]
sm2n_ has joined #lisp
sm2n has quit [Read error: Connection reset by peer]
sm2n_ has quit [Read error: Connection reset by peer]
sm2n_ has joined #lisp
lansiir has quit [Ping timeout: 240 seconds]
maiqthefalse has joined #lisp
lansiir has joined #lisp
<Josh_2> mfiano: thanks
CrashTestDummy2 has joined #lisp
sm2n_ has quit [Ping timeout: 252 seconds]
muyinliu has joined #lisp
muyinliu has quit [Client Quit]
CrashTestDummy3 has quit [Ping timeout: 240 seconds]
lansiir has quit [Ping timeout: 265 seconds]
sm2n has joined #lisp
pjb has joined #lisp
sm2n has quit [Ping timeout: 252 seconds]
lansiir has joined #lisp
RhodiumTo4d has quit [Ping timeout: 260 seconds]
benjamin-l has joined #lisp
monkey__ has joined #lisp
jnewton` has joined #lisp
karlosz has quit [Quit: karlosz]
jnewton` has quit [Ping timeout: 252 seconds]
Cristi4nBerteleg has joined #lisp
dilated_dinosaur has quit [Ping timeout: 268 seconds]
orivej has joined #lisp
jnewton` has joined #lisp
Josh_2 has quit [Ping timeout: 260 seconds]
dilated_dinosaur has joined #lisp
prxq_ has joined #lisp
prxq has quit [Ping timeout: 240 seconds]
Sauvin has quit [Remote host closed the connection]
Sauvin has joined #lisp
CrazyPython has quit [Read error: Connection reset by peer]
karlosz has joined #lisp
jnewton` has quit [Ping timeout: 240 seconds]
davisr has joined #lisp
davisr_ has quit [Ping timeout: 240 seconds]
karlosz has quit [Read error: No route to host]
karlosz has joined #lisp
irc_user has joined #lisp
<beach> Good morning everyone!
mindCrime has quit [Ping timeout: 240 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
monkey__ has quit [Remote host closed the connection]
Oladon has joined #lisp
pbaille has joined #lisp
pbaille has quit [Ping timeout: 265 seconds]
Stanley00 has joined #lisp
sm2n has joined #lisp
CrashTestDummy has joined #lisp
CrashTestDummy2 has quit [Ping timeout: 240 seconds]
Cristi4nBerteleg has quit [Remote host closed the connection]
drl has quit [Quit: Leaving]
orivej has quit [Ping timeout: 246 seconds]
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
psilotorp has quit [Remote host closed the connection]
aartaka_d has joined #lisp
psilotorp has joined #lisp
aartaka has quit [Ping timeout: 252 seconds]
orivej has joined #lisp
waleee-cl has quit [Quit: Connection closed for inactivity]
psilotorp has quit [Ping timeout: 245 seconds]
Oladon has quit [Quit: Leaving.]
maiqthefalse has quit [Quit: Connection closed for inactivity]
benjamin-l has quit [Quit: WeeChat 3.1]
pbaille has joined #lisp
mindCrime has joined #lisp
narimiran has joined #lisp
psilotorp has joined #lisp
frost-lab has joined #lisp
psilotorp has quit [Ping timeout: 250 seconds]
jnewton` has joined #lisp
mindCrime has quit [Ping timeout: 252 seconds]
Sauvin has quit [Remote host closed the connection]
Sauvin has joined #lisp
<flip214> rpg: understood. Do you have the code to make ITERATE "understand" (or just allow?) CL-WHO:HTM?
narimiran has quit [Ping timeout: 265 seconds]
jnewton` has quit [Ping timeout: 252 seconds]
gaqwas has joined #lisp
gaqwas has quit [Changing host]
gaqwas has joined #lisp
gaqwas has quit [Remote host closed the connection]
monolithic has joined #lisp
TK__ has joined #lisp
defaultxr has quit [Read error: Connection reset by peer]
defaultxr has joined #lisp
niflce has joined #lisp
shka_ has joined #lisp
<engblom> I found this: https://common-lisp.net/project/iterate/doc/Don_0027t-Loop-Iterate.html#Don_0027t-Loop-Iterate. Is this article biased or does the channel agree?
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #lisp
rgherdt has joined #lisp
ebrasca has joined #lisp
edgar-rft has quit [Remote host closed the connection]
edgar-rft has joined #lisp
<engblom> Is anyone of you here responsible for https://riptutorial.com/common-lisp/example/21976/the-do-loop ?
<moon-child> beach: in your fast generic dispatch paper, why do you use two words instead of one for a general instance? I don't quite see the rationale; and it increases memory use and indirection
prxq_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
prxq has joined #lisp
jnewton` has joined #lisp
<moon-child> and if you were to use two words, why not make the stamp be the first word and place the class in the rack? That way you can prefetch the rack before beginning the dispatch process, and only need to wait for one memory access
loskutak has joined #lisp
Nilby has joined #lisp
<saturn2> engblom: i think there are mixed opinions on iterate, some people like it and some don't
mindCrime has joined #lisp
<phoe> engblom: this tutorial is shit
<phoe> these examples do not even compile
<phoe> please abandon ship and use something that actually works, e.g. PCL
<engblom> phoe: I know, that is why I asked if someone here is responsible for it. I wanted to PM that person with corrections
<phoe> engblom: the footer of that webpage has hints
<phoe> doesn't look like it's updateable.
<engblom> phoe: I stumbled upon it when trying to find a clean and simple construct that allows me to first bind variables and then repeat until condition is met. (do ...) seems to check the condition before the loop, so it does not do what I want.
varjag has joined #lisp
<phoe> engblom: you could try LOOP for that
<phoe> (loop for x in '(1 3 5 7 8 9 11 13 15) do (print x) when (evenp x) do (loop-finish))
psilotorp has joined #lisp
<engblom> phoe: I am searching for the equivalent of (loop [x "foo" y "bar] (do-something-with x y) (when something (recur)))
psilotorp has quit [Ping timeout: 245 seconds]
<moon-child> what do you mean by (when something (recur))?
<phoe> engblom: (loop with x = "foo" with y = "bar" unless something (do ...))
<engblom> moon-child: That was Clojure, and I am searching for how to do it in CL. So something cleaner than (let (()) (loop .... (return)))
<phoe> oh wait, RETURN aborts the looping altogether
<phoe> you want something that breaks the loop or just a single iteration?
<engblom> phoe: I am searching for a way to bind a few variables and then at least once do the iteration, but keep iterating until a condition is met (which is coming from actually reading some information and got nothing to do with the loop variables)
<phoe> that's what I wrote above, (loop ... when ... do (loop-finish))
<engblom> Okay, thanks!
<phoe> execute that example in the CL REPL and see that after the even number nothing else is printed, the iteration is terminated
<moon-child> you can also do (loop with ... do ... until ...)
<flip214> TAGBODY for the win! No, in reality I'm an ITERATE user.
<engblom> moon-child: Thank you, that was what I was looking for!
<phoe> moon-child: oh right, I actually didn't think about this one!
narimiran has joined #lisp
Lord_of_Life has quit [Read error: Connection reset by peer]
Lord_of_Life has joined #lisp
<pjb> engblom: (loop with i = 0 while (< i 10) collect (incf i)) #| --> (1 2 3 4 5 6 7 8 9 10) |#
<pjb> engblom: (with-input-from-string (*standard-input* "1 1 1 1 0") (loop with i = 0 while (plusp (read)) collect (incf i))) #| --> (1 2 3 4) |#
<beach> engblom: I use LOOP for everything. I see no reason to use an external library when the standardized operator will do.
<moon-child> pjb: the collect/do should be before the condition
<moon-child> engblom wants the loop to always run at least once
<pjb> engblom: or of course, if you want until: (with-input-from-string (*standard-input* "1 1 1 1 0") (loop with i = 0 collect (incf i) until (zerop (read)))) #| --> (1 2 3 4 5) |#
<pjb> moon-child: right.
<beach> moon-child: You have to be able to change the class and the instance contents without changing the identity.
<pjb> engblom: Note you can move the while after: (with-input-from-string (*standard-input* "1 1 1 1 0") (loop with i = 0 collect (incf i) while (plusp (read)))) #| --> (1 2 3 4 5) |#
<pjb> engblom: while/until is just whether you test the stop condition or it's negation.
<pjb> engblom: You can also have while or until in the middle, or several of them.
<beach> moon-child: The stamp and the class must evolve separately. The stamp is the unique number of the class as it was when the instance was created, and it is used to detect obsolete instances.
<moon-child> beach: that shouldn't be an issue as long as you don't change the number of cells in the object
<engblom> pjb: Thank you, now it makes more sense!
<pjb> (with-input-from-string (*standard-input* "1 1 1 1 1 1 1 0") (loop with i = 0 while (plusp (read)) collect (incf i) while (plusp (read)) collect 0 while (plusp (read)))) #| --> (1 0 2 0 3) |#
<pjb> engblom: the best is to read clhs format
frgo has quit [Remote host closed the connection]
<pjb> s/clhs format/clhs loop/
<pjb> and section 6.1 The LOOP Facility
<pjb> clhs 6.1
<beach> moon-child: But the number of cells change as a result of either change-class or class redefinition.
<engblom> pjb: Many times I have looked at the clhs but very often I have trouble understanding it. Often I end up searching for examples instead. As I get more used to CL I hope to get better at reading clhs too
cranium_ has joined #lisp
imode has quit [Ping timeout: 268 seconds]
<beach> moon-child: There is also an issue with threads. I want the rack to be self-contained, so that a thread that needs to modify the structure of a rack is obliged to allocate a new rack and assign it to the header using CAS.
<moon-child> I see
frost-lab has quit [Quit: Ping timeout (120 seconds)]
<beach> There has to be an indirection, but it might be possible to make it work with a single word. But then, the GC for the global heap allocates these headers and also CONS cells in a free list, so that they won't move. Because they are all the same size.
<pjb> engblom: the trick when learning a programming language, is to write the examples oneself.
<pjb> engblom: so you read a clhs page, and try examples at the REPL right awaya.
<pjb> s/a./.
<pjb> engblom: this is what I just did above with those loops…
aartaka has joined #lisp
aartaka_d has quit [Ping timeout: 240 seconds]
<engblom> beach: What is your opinion about alexandria?
mindCrime has quit [Ping timeout: 246 seconds]
<beach> engblom: I have no opinion about it. I haven't used it much, but some of the libraries I use, use Alexandria as well, so I use it indirectly.
<pjb> engblom: what is YOUR opinion about alexandria?
<engblom> pjb: I am new to CL, so I do not have much opinion yet, but I found iota and when-let to be useful from alexandria, and later maybe I find something else there I would use too.
<pjb> ok. So: useful.
<engblom> pjb: I am mostly trying to find out what I in general accepted and not accepted so I do not develop bad habits from the beginning.
<pjb> Don't worry.
<beach> engblom: Alexandria is used a lot, so I think it must be fine.
silasfox has joined #lisp
<splittist> beach: so is C (used a lot)
* splittist realises he has been under a misapprehension about the ordering of unconditional and termination-test clauses in LOOP (and wonders how many over-complicated loops he can rewrite...)
<beach> engblom: Alexandria is used a lot by some Common Lisp programmers that I respect a lot because they write maintainable and modular code, so I think it must be fine.
<splittist> engblom: but Alexandria is great, in case you misunderstood me (:
sm2n has quit [Ping timeout: 240 seconds]
hiroaki has joined #lisp
orivej has quit [Ping timeout: 260 seconds]
sm2n has joined #lisp
sm2n has quit [Excess Flood]
sm2n has joined #lisp
<shka_> alexandria is perhaps the least controversial utility library there is
<shka_> and implements a lot of functions that are used by almost everyone
<shka_> like shuffle, hash-table-keys/hash-table-values and so one
silasfox has quit [Quit: WeeChat 3.1]
silasfox has joined #lisp
sm2n has quit [Ping timeout: 240 seconds]
silasfox has quit [Client Quit]
silasfox has joined #lisp
<engblom> Then I will continue to use alexandria with good conscience.
long4mud_ has joined #lisp
long4mud has quit [Ping timeout: 252 seconds]
<shka_> yes, i don't think anybody will ever criticize you for using the alexandria
long4mud has joined #lisp
long4mud_ has quit [Ping timeout: 240 seconds]
frost-lab has joined #lisp
karlosz has quit [Ping timeout: 260 seconds]
anticrisis has quit [Read error: Connection reset by peer]
frost-lab has quit [Ping timeout: 260 seconds]
zooey has quit [Remote host closed the connection]
zooey has joined #lisp
dmiles_afk has joined #lisp
dmiles_afk has quit [Remote host closed the connection]
dmiles_afk has joined #lisp
hendursa1 has joined #lisp
pve has joined #lisp
Bourne has joined #lisp
hendursaga has quit [Ping timeout: 240 seconds]
aartaka_d has joined #lisp
pve has quit [Ping timeout: 246 seconds]
heisig has joined #lisp
pve has joined #lisp
aartaka has quit [Ping timeout: 252 seconds]
frost-lab has joined #lisp
<jdz> engblom: I see nobody has suggested PROG yet, so: (prog ((x "foo") (y "bar")) recur (do-something-with x y) (when something (go recur)) (return return-value))
sm2n has joined #lisp
<engblom> jdz: Thanks!
sm2n_ has joined #lisp
sm2n has quit [Read error: Connection reset by peer]
edgar-rft has quit [Ping timeout: 265 seconds]
edgar-rft has joined #lisp
sm2n_ has quit [Remote host closed the connection]
sm2n has joined #lisp
<phoe> oh boy, I see explicit control flow
<phoe> PROG is useful for writing simple state machines
<phoe> this includes iteration
sm2n_ has joined #lisp
sm2n has quit [Read error: Connection reset by peer]
TK__ has quit [Ping timeout: 245 seconds]
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #lisp
<pjb> beach: perhaps of interest (or not): The Sociology of Programming Languages (2014) <https://www.youtube.com/watch?v=M4Gsl8sVgdQ>
<beach> Yes, thanks!
lotuseater has joined #lisp
heisig has quit [Quit: Leaving]
pve_ has joined #lisp
pve has quit [Ping timeout: 252 seconds]
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #lisp
pve_ is now known as pve
sm2n_ has quit [Remote host closed the connection]
cosimone has joined #lisp
sm2n_ has joined #lisp
sm2n_ has quit [Read error: Connection reset by peer]
irc_user has quit [Quit: Connection closed for inactivity]
sm2n_ has joined #lisp
monolithic has quit [Ping timeout: 240 seconds]
grobe0ba has quit [Ping timeout: 252 seconds]
grobe0ba has joined #lisp
botnet has joined #lisp
botnet has quit [Client Quit]
mindCrime has joined #lisp
botnet has joined #lisp
sm2n has joined #lisp
sm2n_ has quit [Ping timeout: 260 seconds]
sm2n has quit [Remote host closed the connection]
sm2n has joined #lisp
sm2n has quit [Excess Flood]
sm2n has joined #lisp
monolithic has joined #lisp
sm2n has quit [Remote host closed the connection]
monolithic has quit [Remote host closed the connection]
skapata has quit [Remote host closed the connection]
sm2n has joined #lisp
monolithic has joined #lisp
monolithic has quit [Read error: Connection reset by peer]
vegansbane69636 has quit [Quit: The Lounge - https://thelounge.chat]
monolithic has joined #lisp
sm2n has quit [Excess Flood]
sm2n has joined #lisp
sm2n has quit [Excess Flood]
sm2n has joined #lisp
sm2n has quit [Remote host closed the connection]
sm2n has joined #lisp
botnet has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
sm2n has quit [Excess Flood]
masp has joined #lisp
sm2n has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
sm2n has quit [Excess Flood]
sm2n has joined #lisp
amb007 has joined #lisp
nitrix has quit [Quit: Genius is one percent inspiration and ninety-nine percent perspiration]
kevingal has joined #lisp
mindCrime has quit [Ping timeout: 246 seconds]
frgo has joined #lisp
nitrix has joined #lisp
frgo has quit [Ping timeout: 250 seconds]
mrchampion has quit [Ping timeout: 260 seconds]
sm2n has quit [Remote host closed the connection]
sm2n has joined #lisp
sm2n has quit [Excess Flood]
sm2n has joined #lisp
sm2n has quit [Remote host closed the connection]
sm2n has joined #lisp
Stanley00 has quit [Remote host closed the connection]
<jmercouris> I'm trying to think of the simplest way to do something, I have a plist (:a 1 :b 2)
Stanley|00 has joined #lisp
<jmercouris> and I want to get the result (1 2)
<jmercouris> by passing in the input (:a :b)
<jmercouris> I could write a loop with getf
<jmercouris> is there a better way?
<jmercouris> that is; (loop for i in '(:a :b) collect (getf '(:a 1 :b 2) i))
<jackdaniel> (loop for (key val) on list by #'cddr when (member key '(:a :b)) collect val)
<jmercouris> there is a when missing from the list
<jmercouris> yes
<jmercouris> I just realized!
sm2n_ has joined #lisp
sm2n has quit [Ping timeout: 240 seconds]
kini has quit [Remote host closed the connection]
kini has joined #lisp
niflce has quit [Ping timeout: 260 seconds]
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
sm2n_ has quit [Remote host closed the connection]
sm2n has joined #lisp
<pjb> (let ((plist '(:a 1 :b 2))) (mapcar (lambda (key) (getf plist key)) '(:a :b))) #| --> (1 2) |#
mrchampion has joined #lisp
<flip214> jmercouris: if the plist becomes very long, you might want to transform it to a hash-table or so before doing the lookups
<jmercouris> plist is only 2-10 elements
<pjb> so no need for a hash-table, it wouldn't cover the cost.
<jmercouris> agreed.
sm2n has quit [Excess Flood]
sm2n has joined #lisp
frgo has joined #lisp
Stanley|00 has quit [Remote host closed the connection]
engblom has quit [Quit: leaving]
Stanley00 has joined #lisp
waleee-cl has joined #lisp
xkapastel has joined #lisp
vegansbane69636 has joined #lisp
engblom has joined #lisp
Stanley00 has quit [Ping timeout: 240 seconds]
orivej has joined #lisp
<flip214> how many lookups will there be? 10 concurrent elements in a plist but a few thousand lookups might be different again...
<jackdaniel> for small tables hashing cost may be bigger than simple traversal
sm2n has quit [Remote host closed the connection]
sm2n has joined #lisp
jeosol has quit [Quit: Connection closed]
<flip214> jackdaniel: eg. SBCL stores a hash value for symbols, so for keywords it's just following a pointer.
botnet has joined #lisp
ljavorsk has joined #lisp
Stanley00 has joined #lisp
Stanley00 has quit [Remote host closed the connection]
Stanley00 has joined #lisp
xsperry has quit [Remote host closed the connection]
xsperry has joined #lisp
Stanley00 has quit [Ping timeout: 265 seconds]
yoonkn has joined #lisp
pfdietz has joined #lisp
<pjb> Of course, if what you want is this: (let ((plist '(:a 1 :b 2)) (keys '(:a :b :a :a :a :b :b :b :a :a :a :b :a))) (mapcar (lambda (key) (getf plist key)) keys)) #| --> (1 2 1 1 1 2 2 2 1 1 1 2 1) |#
<pjb> But still with 5 or fewer entries, getf is faster than gethash, because gethash has to compute a sxhash, which is slow compared to 5 compare and 5 memory fetches…
Gromboli has quit [Ping timeout: 260 seconds]
surabax has joined #lisp
silasfox has quit [Quit: WeeChat 3.1]
kmeow has joined #lisp
botnet has quit [Ping timeout: 268 seconds]
jasom has quit [Ping timeout: 276 seconds]
housel has quit [Ping timeout: 276 seconds]
jlf has joined #lisp
housel has joined #lisp
jasom has joined #lisp
pbaille has quit [Quit: Leaving...]
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
sm2n_ has joined #lisp
sm2n has quit [Read error: Connection reset by peer]
sm2n_ has quit [Read error: Connection reset by peer]
sm2n_ has joined #lisp
sm2n_ has quit [Read error: Connection reset by peer]
sm2n_ has joined #lisp
Bike has joined #lisp
pfdietz has quit [Ping timeout: 240 seconds]
<engblom> If I want to know where the code I am running is stored, can I do it? In my case I want to find by code where the package is so I am able to give the full path to the settings directory inside of the package.
<engblom> Right now I have it hardcoded with (defparameter ..)
<engblom> Like this: (defparameter project-root "~/common-lisp/gpon")
<phoe> you can locate ASDF systems
<phoe> not individual packages
<phoe> on my machine, (asdf:system-source-directory :phoe-toolbox) ;=> #P"/home/phoe/Projects/Lisp/phoe-toolbox/"
pjb has quit [Quit: rebooting macOS for update…]
silasfox has joined #lisp
<engblom> phoe: Thanks
Dyedefra has joined #lisp
sm2n has joined #lisp
sm2n_ has quit [Ping timeout: 252 seconds]
silasfox has quit [Client Quit]
niflce has joined #lisp
sm2n has quit [Read error: Connection reset by peer]
hjudt has quit [Ping timeout: 252 seconds]
pjb has joined #lisp
sm2n_ has joined #lisp
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #lisp
silasfox has joined #lisp
Lord_of_Life_ has joined #lisp
random-nick has joined #lisp
Lord_of_Life has quit [Ping timeout: 240 seconds]
Lord_of_Life_ is now known as Lord_of_Life
orivej has quit [Ping timeout: 265 seconds]
Noisytoot has quit [Quit: ZNC 1.8.2 - https://znc.in]
Noisytoot has joined #lisp
<engblom> Besides first converting to string (with namestring) and then concatenating the directory I want, can I add to that path in a more elegant way?
<pjb> Sure.
<pjb> (merge-pathnames #P"*.lisp" (asdf:system-source-directory :alexandria) nil) #| --> #P"/Users/pjb/quicklisp/dists/quicklisp/software/alexandria-20210411-git/*.lisp" |#
<pjb> (first (directory (merge-pathnames #P"**/*.lisp" (asdf:system-source-directory :alexandria) nil))) #| --> #P"/Users/pjb/quicklisp/dists/quicklisp/software/alexandria-20210411-git/alexandria-1/arrays.lisp" |#
<engblom> pjb: Thanks!
sm2n_ has quit [Remote host closed the connection]
<pjb> (merge-pathnames #P"alexandria-1/arrays.lisp" (asdf:system-source-directory :alexandria) nil) #| --> #P"/Users/pjb/quicklisp/dists/quicklisp/software/alexandria-20210411-git/alexandria-1/arrays.lisp" |#
sm2n has joined #lisp
<pjb> engblom: note if the item you want is a file in the directory, you can also use make-pathname directly:
Gromboli has joined #lisp
<engblom> pjb: I actually want a specific file: settings/meprof.lisp inside of the source directory
<pjb> (make-pathname :name "arrays" :type "lisp" :version nil :defaults #P"/Users/pjb/quicklisp/dists/quicklisp/software/alexandria-20210411-git/alexandria-1/") #| --> #P"/Users/pjb/quicklisp/dists/quicklisp/software/alexandria-20210411-git/alexandria-1/arrays.lisp" |#
<pjb> engblom: in that case merge-pathnames as indicated.
silasfox has quit [Quit: WeeChat 3.1]
<pjb> (merge-pathnames #P"settings/meprof.lisp" *source-dir* nil)
undvrainbowvita8 has quit [Quit: EXIT]
<engblom> pjb: Thanks, that does exactly what I want
CrazyPython has joined #lisp
undvrainbowvita8 has joined #lisp
orivej has joined #lisp
hjudt has joined #lisp
botnet has joined #lisp
sm2n_ has joined #lisp
sm2n has quit [Ping timeout: 260 seconds]
silasfox has joined #lisp
silasfox has quit [Client Quit]
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #lisp
narimiran has quit [Ping timeout: 240 seconds]
Lycurgus has joined #lisp
Duuqnd has quit [Ping timeout: 245 seconds]
MrtnDk[m] has quit [Ping timeout: 245 seconds]
xzax_[m] has quit [Ping timeout: 276 seconds]
Duuqnd has joined #lisp
Duuqnd is now known as Guest95354
theo[m] has quit [Ping timeout: 245 seconds]
MrtnDk[m] has joined #lisp
sm2n_ has quit [Read error: Connection reset by peer]
sm2n_ has joined #lisp
xzax_[m] has joined #lisp
ober has quit [Remote host closed the connection]
bitmapper has joined #lisp
theo[m] has joined #lisp
jcowan has quit [Ping timeout: 276 seconds]
drmeister has quit [Read error: Connection reset by peer]
jlpeters has quit [Ping timeout: 250 seconds]
drmeister has joined #lisp
avicenna has quit [Ping timeout: 258 seconds]
jcowan has joined #lisp
jlpeters has joined #lisp
wsinatra has joined #lisp
avicenna has joined #lisp
madage has quit [Remote host closed the connection]
sm2n_ has quit [Read error: Connection reset by peer]
sm2n_ has joined #lisp
Inline has joined #lisp
hiroaki has quit [Ping timeout: 260 seconds]
pfdietz has joined #lisp
Stanley00 has joined #lisp
yoonkn has quit [Read error: Connection reset by peer]
yoonkn has joined #lisp
jnewton` has quit [Read error: Connection reset by peer]
jnewton` has joined #lisp
madage has joined #lisp
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #lisp
t1054Gues has joined #lisp
Guest10524 has quit [Ping timeout: 240 seconds]
Stanley00 has quit [Ping timeout: 240 seconds]
ebrasca has quit [Remote host closed the connection]
CrashTestDummy2 has joined #lisp
ebrasca has joined #lisp
yoonkn` has joined #lisp
hiroaki has joined #lisp
sauvin_ has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 26.3)]
rgherdt_ has joined #lisp
CrazyPyt_ has joined #lisp
CrazyPython has quit [Read error: Connection reset by peer]
rgherdt has quit [Remote host closed the connection]
edgar-rft has quit [Remote host closed the connection]
alandipert has quit [Quit: Ping timeout (120 seconds)]
DGASAU` has joined #lisp
jnewton`` has joined #lisp
alandipert3 has joined #lisp
DGASAU has quit [Remote host closed the connection]
f4r59838 has joined #lisp
loke` has joined #lisp
CrashTestDummy has quit [Ping timeout: 240 seconds]
edgar-rft has joined #lisp
brass has quit [Remote host closed the connection]
brass has joined #lisp
fengshaun_ has joined #lisp
sm2n has joined #lisp
Noisytoot_ has joined #lisp
yoonkn has quit [Read error: Connection reset by peer]
Sauvin has quit [Remote host closed the connection]
sm2n_ has quit [Ping timeout: 240 seconds]
Dyedefra has quit [Remote host closed the connection]
f4r5983 has quit [Quit: Ping timeout (120 seconds)]
Jesin has quit [Ping timeout: 240 seconds]
borodust has quit [Quit: Leavin']
ntr has quit [Quit: ZNC - https://znc.in]
jrm has quit [Quit: ciao]
Inoperable has quit [Quit: All your buffer are belong to us!]
Noisytoot has quit [Quit: ZNC 1.8.2 - https://znc.in]
herlocksholmes has quit [Quit: Hasta la victoria, siempre!]
Spawns_Carpetin- has quit [Remote host closed the connection]
fengshaun has quit [Quit: bibi!]
loke has quit [Remote host closed the connection]
DyedefGNU has joined #lisp
jrm2 has joined #lisp
borodust has joined #lisp
Spawns_Carpeting has joined #lisp
herlocksholmes has joined #lisp
jrm2 is now known as jrm
psilotorp has joined #lisp
jnewton` has quit [Ping timeout: 240 seconds]
ntr has joined #lisp
APic has quit [Ping timeout: 240 seconds]
sm2n has quit [Ping timeout: 252 seconds]
In0perable has joined #lisp
sm2n has joined #lisp
long4mud has quit [Quit: WeeChat 3.0.1]
orivej has quit [Ping timeout: 240 seconds]
botnet has quit [Ping timeout: 252 seconds]
DyedefGNU has quit [Quit: quit]
Dyedefra has joined #lisp
dhil has joined #lisp
atw has quit [Ping timeout: 246 seconds]
sm2n_ has joined #lisp
sm2n has quit [Ping timeout: 252 seconds]
hypercube has quit [Quit: WeeChat 3.1]
narimiran has joined #lisp
rpg has quit [Quit: Textual IRC Client: www.textualapp.com]
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #lisp
sm2n has joined #lisp
sm2n_ has quit [Ping timeout: 252 seconds]
oni-on-ion has joined #lisp
APic has joined #lisp
CrashTestDummy3 has joined #lisp
niflce has quit [Ping timeout: 252 seconds]
oni-on-ion has quit [Remote host closed the connection]
sm2n has quit [Ping timeout: 240 seconds]
CrashTestDummy2 has quit [Ping timeout: 240 seconds]
aeth_ has joined #lisp
aeth has quit [Disconnected by services]
aeth_ is now known as aeth
CrashTestDummy has joined #lisp
<engblom> I want to define a function that takes an optional argument. In case the argument is not given I want it to have a default value. The first part I know I can do with &optional, but how do I get the default value unless it is given? Can I do it directly in the function definition or do I need a separate if statement that checks if it is nil and then sets it to the default value?
<beach> (defun (&optional (parameter default-value-form)) ...)
botnet has joined #lisp
<engblom> beach: Thanks!
<beach> engblom: And the only place where Common Lisp has "statements" is in a TAGBODY.
CrashTestDummy3 has quit [Ping timeout: 260 seconds]
<beach> clhs 3.4.1
silasfox has joined #lisp
<beach> And you wouldn't check whether the parameter is NIL. You would use the SUPPLIED-P-PARAMETER instead as that page indicates.
oni-on-ion has joined #lisp
CrazyPython has joined #lisp
oni-on-ion has quit [Ping timeout: 245 seconds]
dbohdan has left #lisp [#lisp]
CrazyPyt_ has quit [Ping timeout: 260 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
<pjb> beach: engblom: it's a little mischevious to say that there are statements in tagbody. They're just usual expressions whose values are ignored, just like most expressions in progn, prog1, prog2, prog, prog*, progv, locally, block, catch, unwind-protect, etc, etc, etc.
sauvin_ is now known as Sauvin
<pjb> granted they used the non-terminal name /statement/, but that's all. Just to distinguish those expressions from the tags.
<pjb> well, ok, prog and prog* use tagbody so they also have those expressions called /statement/…
<beach> I couldn't really say something like "Common Lisp does not have `statements'", because of that non-terminal.
<beach> Also, they are not arbitrary forms. They have to be compound forms.
<splittist> tagbody; RETURN is referred to as a statement; PROG, PROG* also use 'statement' as a compound form; SETQ is referred to as the 'simple variable assignment statement of Lisp'... (:
<Nilby> Maybe declarations are sort of like statements since they don't have value?
<pjb> but declaratons are not evaluated.
<beach> Nilby: No, such things are referred to as "expressions" and not "forms".
<pjb> and cannot be: (locally (declare (special *f*)) (print 'hi) (declare (type integer *f*)) (print 'lo)) #| hi ERROR: While compiling an anonymous function : The DECLARE expression (declare (type integer *f*)) is being treated as a form, possibly because it's the result of macroexpansion. DECLARE expressions can only appear in specified contexts and must be actual subexpressions of the containing forms. |#
<pjb> Note, it says FORM, not STATEMENT.
<pjb> Expressions that return no values, such as (values) 1- are still called expressions, 2- are still expression in that they still produce a value if a value is expected: (list (values) (values) (values)) #| --> (nil nil nil) |# and 3- are still valid in any place an expression is valid. And therefore cannot be called statements.
<pjb> The difference between statement vs. expression exist in languages where they are not interchangeable.
<pjb> For example, in C, you cannot write: int a=0; b=if(a<0){return 3;}else{ return 4;} because if is a statement. (you have to write int a=0; b=(a<0)?3:4; since ?: is an operator for an expression.
<splittist> (And GO is referred to as a statement, of course, which is where we started.)
<pjb> GO is a special operator. A GO form such as (GO foo) is an expression. Even if it does not return, it is still an expression: it can be used anywhere an expression can.
<beach> pjb: No, it can not. But it can be used anywhere a FORM can be used.
<splittist> "[PROG and PROG*] permit use of the return statement, and they permit use of the go statement."
<splittist> "statement" looks like one of those terms that was intended to be a glossary entry, but never made it in.
<beach> Note to self: in WSCL define STATEMENT in the glossary, or eliminate the use of the term. If the term is retained, make sure it is used the same way everywhere.
<pjb> expression n. 1. an object, often used to emphasize the use of the object to encode or represent information in a specialized format, such as program text. ``The second expression in a let form is a list of bindings.'' 2. the textual notation used to notate an object in a source file. ``The expression 'sample is equivalent to (quote sample).''
<pjb> form n. 1. any object meant to be evaluated. 2. a symbol, a compound form, or a self-evaluating object. 3. (for an operator, as in ``<<operator>> form'') a compound form having that operator as its first element. ``A quote form is a constant form.''
<pjb> beach: indeed, by these definition.
<pjb> I used a more restrictive definition of expression = form, in the controverse expression vs. statement.
Lycurgus has quit [Quit: Exeunt]
<Nilby> I am disappoint. (values) is a lie
jnewton`` has quit [Ping timeout: 246 seconds]
<pjb> Nilby: half a lie: (values) #| |# (let ((x (values))) x) #| --> nil |# But note: (let (x) x) #| --> nil |#
<pjb> or again: (multiple-value-call (function list) (values) (values 1 2) (values) (values 3 4) (values)) #| --> (1 2 3 4) |#
<pjb> so really, values returns nothing.
<Nilby> so there's secretly a nil already sitting in every form?
<phoe> in every form? what do you mean
<phoe> missing values are coerced into NIL, there's no secret NILs anywhere
<phoe> (multiple-value-bind (a b c d) (values) (list a b c d)) ;=> (NIL NIL NIL NIL)
<Nilby> (values) is actually a value then i.e. a #<novalue> object
<phoe> not really?
<Nilby> how can one coerce a thing that doesn't exist?
<phoe> in a simple way - conceptually, every function returns an implicit vector of values
<phoe> most of the time, it is a vector of length 1
Jesin has joined #lisp
<phoe> (values) returns a vector of length 0
<phoe> and if you normally try to get a 1st element of a 0-length vector, that would be an error - instead, CL defines that to return NIL in case of missing values
<Nilby> I know it's just a weird philosophical point, but "no values" is actually a value in a way.
<phoe> not a first-class thing in CL though
<phoe> unless you use MULTIPLE-VALUE-CALL, at which point you still operate on lists and not on "no values" objects
dilated_dinosaur has quit [Ping timeout: 240 seconds]
<Nilby> we have accessor "values" for a thing which supposedly isn't there
mister_m_ has joined #lisp
<Nilby> I find it interesting that (locally) -> nil
cranium_ has quit [Quit: Leaving]
<phoe> it's just defined to be this way, same as (setq) and (progn) and what else
<phoe> but we also have SETF for places, which aren't a first-class concept either
<pjb> multiple values are implemented by storing them in registers, with a register holding the count of values.
<Nilby> but I can accept that setf forms are a macro expansion to something with values
<pjb> say, mv-count mv-0 mv-1 mv-2 …
dilated_dinosaur has joined #lisp
<pjb> so when you write (setf x (values)) it does (funcall (function values)) (setf x (if (zerop mv-count) nil mv-0))
<pjb> If you write (multiple-value-setq (x y z) (values 1 2)) it does (funcall (function values) 1 2) (setf x (if (zerop mv-count) nil mv-0) y (if (< mv-count 2) nil mv-1) z (if (< mv-count 3) nil mv-2))
<pjb> it's not a vector or a list in the sense that it's not a lisp object, it's just registers. (But that can also be memory storage, when there are not enough registers), since the minimal value for multiple-values-limit is 20, and people are still buying processors without as many registers…
whosit has quit [Read error: Connection reset by peer]
<Nilby> I know how it works both interpreted and compiled, but on an abstract level I feel like (values) is a hole in the logical consistency of Lisp.
whosit has joined #lisp
<beach> Yeah, lets update the standard.
jnewton`` has joined #lisp
sm2n has joined #lisp
<pjb> Nilby: that's the point of CL: it's full of inconsistency, so that it's compatible with existing code, and it let implementations easily be fast.
nlif[m] has joined #lisp
Guest95354 is now known as Duuqnd
<Nilby> I love that CL has multiple values, it's very useful. (values) just feels like a weird Gödel-like thing in McCarthy's lovely universal function. Although I guess all the special operators are logically troublesome. Even quote is weird.
zaquest has quit [Quit: Leaving]
<beach> Nilby: It is not a special case. That form returns 0 values. The general rule is that of more values are required by the caller than what the callee supplies, then the remaining values required are initialized to NIL.
<phoe> Nilby: I wonder why it's weird
<phoe> (values) is to (values 1 2 3) like (m-v-b (x) (values) ...) is to (m-v-b (a b c x) (values 1 2 3) ...)
<phoe> you request more values than you have, so you get NIL for the missing ones
<beach> Nilby: So if the caller wants one value and the callee does (values) when it returns, then NIL is what the caller gets.
<phoe> doesn't matter if it's the 0th or the 1st or the 42th value (if your implementation permits 42 values)
<ebrasca> Did someone try to run reddit1.0?
<phoe> still seems consistent to me
<phoe> ebrasca: I did, the official release doesn't build
<splittist> As was pointed out before, it's a logical extension of the concept, like (+) (:
<phoe> it needs some fixes and what else in order to even compile, and it doesn't run even after it compiles
zaquest has joined #lisp
<ebrasca> phoe: Do you think it is good software? Or is it better to start from scrach?
<phoe> ebrasca: reddit 1.0 is written like a quick hack, I'd definitely do a lot of refactoring on it if I ever wanted to use that codebase
<ebrasca> phoe: Did you see this one https://github.com/tamurashingo/reddit1.0 ?
<phoe> ebrasca: nope, didn't see it, I don't know how this one works.
<ebrasca> It loads , but I get some error when creating the DB.
skapata has joined #lisp
<ebrasca> phoe: Thanks!
Bourne has quit [Ping timeout: 240 seconds]
StuartMalcolm has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
<ebrasca> phoe: How is you CL spec going?
sm2n has quit [Remote host closed the connection]
sm2n has joined #lisp
<phoe> ebrasca: at the moment it isn't, too many other things going on
<ebrasca> phoe: Some day I like to go to krakow and see you.
botnet has quit [Ping timeout: 252 seconds]
srhm has joined #lisp
jnewton`` has quit [Ping timeout: 240 seconds]
mseddon1 has quit [Quit: The Lounge - https://thelounge.chat]
alandipert3 has quit [Quit: The Lounge - https://thelounge.chat]
mseddon12 has joined #lisp
mseddon12 has quit [Quit: The Lounge - https://thelounge.chat]
alandipert has joined #lisp
mseddon12 has joined #lisp
bitmapper has quit [Quit: Connection closed for inactivity]
cage_ has joined #lisp
Guest17555 has joined #lisp
muh[m] has joined #lisp
jnewton`` has joined #lisp
nasred1ne has joined #lisp
Bourne has joined #lisp
pve_ has joined #lisp
silasfox has quit [Quit: WeeChat 3.1]
pve has quit [Ping timeout: 268 seconds]
amb007 has quit [Read error: Connection reset by peer]
Guest17555 has quit [Ping timeout: 246 seconds]
amb007 has joined #lisp
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #lisp
buggy_ has joined #lisp
xkapastel has joined #lisp
sm2n has quit [Read error: Connection reset by peer]
sm2n has joined #lisp
Stanley00 has joined #lisp
niflce has joined #lisp
niflce has quit [Client Quit]
buggy_ has quit [Ping timeout: 265 seconds]
Stanley00 has quit [Ping timeout: 240 seconds]
niflce has joined #lisp
yoonkn` has quit [Read error: Connection reset by peer]
amb007 has quit [Ping timeout: 252 seconds]
mister_m_ has quit [Ping timeout: 252 seconds]
amb007 has joined #lisp
jnewton`` has quit [Ping timeout: 240 seconds]
mister_m_ has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
jnewton`` has joined #lisp
Inline has quit [Ping timeout: 260 seconds]
ljavorsk has quit [Ping timeout: 260 seconds]
emet-selch has joined #lisp
terpri has quit [Ping timeout: 250 seconds]
brandflake11 has joined #lisp
v88m has joined #lisp
Josh_2 has joined #lisp
<Josh_2> pjb: Thanks for the links. Its a real shame that those groups dont support any sort of syntax highlighting, makes them a pig to read
sm2n has quit [Read error: Connection reset by peer]
sm2n has joined #lisp
terpri has joined #lisp
Inline has joined #lisp
sm2n has quit [Remote host closed the connection]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
aeth has quit [Ping timeout: 240 seconds]
emet-selch has quit [Ping timeout: 250 seconds]
aeth has joined #lisp
Inline has quit [Quit: Leaving]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
Inline has joined #lisp
jnewton`` has quit [Ping timeout: 265 seconds]
amb007 has quit [Read error: Connection reset by peer]
Sheilong has joined #lisp
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
nasred1ne has quit [Ping timeout: 265 seconds]
<kagevf> jmercouris: get-properties is another way to process plists: http://www.gigamonkeys.com/book/beyond-lists-other-uses-for-cons-cells.html
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
imode has joined #lisp
jnewton`` has joined #lisp
psilotorp has quit [Remote host closed the connection]
psilotorp has joined #lisp
Dyedefra has quit [Quit: quit]
psilotorp has quit [Ping timeout: 250 seconds]
ReAlIsT7 has joined #lisp
cosimone has quit [Remote host closed the connection]
hjudt has quit [Ping timeout: 240 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
CrazyPython has quit [Ping timeout: 252 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
silasfox has joined #lisp
TK__ has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
jnewton`` has quit [Ping timeout: 260 seconds]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
hjudt has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
psilotorp has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
anticrisis has joined #lisp
mindCrime has joined #lisp
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
<pjb> Josh_2: yes, you have to copy and paste in emacs… Sorry.
<pjb> Josh_2: eventually I will copy them and reformat them, but until then…
jann1s has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
cage_ has quit [Quit: rcirc on GNU Emacs 27.1]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
<pjb> Reader macros for shell commands: #! and ! https://ideone.com/wtHikt
jnewton`` has joined #lisp
CrazyPython has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
renzhi has quit [Ping timeout: 260 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
jann1s has quit [Ping timeout: 265 seconds]
amb007 has quit [Read error: Connection reset by peer]
ebrasca has quit [Remote host closed the connection]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
bitmapper has joined #lisp
narimiran has quit [Ping timeout: 252 seconds]
surabax has quit [Quit: Leaving]
jnewton`` has quit [Ping timeout: 240 seconds]
wsinatra has quit [Quit: WeeChat 3.1]
peregu has joined #lisp
<White_Flame> when paredit won't let you delete because it thinks there's an imbalanced parenthesis, how can you get it to show where that imbalance is?
<White_Flame> I have a file that's mostly comments, and something in there is confusing paredit
<phoe> I don't usually have that problem because I use rainbow-parens and I identify missing parens by color
<White_Flame> I don't have any imbalances, and paredit thinks there are
<White_Flame> not even the comments have imbalanced parens
<phoe> huh! interesting
<White_Flame> but I do use #| |#, which paredit doesn't handle well
<Nilby> emacs sometimes up if you have something like the re "^(defun" in docstring or in a multi-line comment
<Nilby> messes up
<White_Flame> again, all parens are balanced, even in the comments. Paren balanced scope doesn't even traverse multiple lines
<White_Flame> I want paredit to show me where it thinks the imbalance is, if possible
aeth has quit [Ping timeout: 260 seconds]
<Nilby> It can't because it would have to fix it's own bug
eddof13 has joined #lisp
<White_Flame> clearly there is a location where it transitions from "balanced" to "imbalanced"
<Nilby> yes, but it's using regular expressions so it doesn't know wtf is actually going on
<White_Flame> oh, well that sucks then
<Nilby> it's only been screwing up for 40 years
<White_Flame> heh
aeth has joined #lisp
<White_Flame> regex is such a hack when used on larger things
<Nilby> I've had to change my comment/docstring formmating until emacs stops failing
<phoe> oh wait, I think I know what's the issue
niflce has quit [Ping timeout: 252 seconds]
<White_Flame> hmm, yeah I think I just fixed it, too. change "|#" to ";;|#" and now it stops whining
<phoe> do you have any lines in a docstring that begin with an open parenthesis?
<Nilby> nice. fake it out with a double comment
<phoe> I remember that this used to trip my emacs up
<White_Flame> no. this is 100% comments, and no paren pair spans lines
<phoe> but might be a different problem
<phoe> OK, I see
<phoe> but is ;;#| valid Lisp? like, does this properly start a multiline comment?
<White_Flame> it's the ending multiline tag
masp has quit [Quit: Konversation terminated!]
<pjb> phoe: nope. ; starts a single line comment. It doesn't matter what's on this line.
<pjb> Nilby: the advice is to use \( when you have to put a parenthesis at the start of a line in docstrings.
<pjb> "\(foo)" --> "(foo)"
<pjb> Reader macros can imbalance paredit, which still uses emacs forward-sexp/backward-sexp instead of a CL lexer/parser.
oni-on-ion has joined #lisp
oni-on-ion has quit [Client Quit]
pve_ has quit [Quit: leaving]
psilotorp has quit [Remote host closed the connection]
peregu has quit [Ping timeout: 265 seconds]
jnewton`` has joined #lisp
jaquatix has joined #lisp
<engblom> I know I have once before asked but I forgot: what is the difference between :use and #:use in defpackage?
jnewton`` has quit [Ping timeout: 252 seconds]
loskutak has quit [Ping timeout: 252 seconds]
<pjb> engblom: :use is a defpackage option name. #:use is nothing.
<pjb> engblom: read:
<pjb> clhs defpackage
<pjb> notably, follow the links string designator, package designator.
jaquatix_ has joined #lisp
jaquatix has quit [Ping timeout: 260 seconds]
<engblom> pjb: Thanks, I found the use of #:use but it must then be specific to mgl-pax:define-package, which is used in that file
<phoe> that's not a standard CL operator so it is allowed to do whatever
akoana has joined #lisp
TK__ has quit [Ping timeout: 245 seconds]
shka_ has quit [Ping timeout: 265 seconds]
StuartMalcolm has quit [Ping timeout: 260 seconds]
hyp has joined #lisp
davisr_ has joined #lisp
jnewton`` has joined #lisp
davisr has quit [Ping timeout: 240 seconds]
<engblom> I will have to use multiple return values. Does CL have destructuring as in Clojure? (meaning I can have something like (defun adding ((x y)) (+ x y)) and then call it with the result of a multivalue function)?
<phoe> engblom: the usual way is to use multiple-value-call
aartaka_d has quit [Read error: Connection reset by peer]
<phoe> destructuring and multiple values are separate concepts in CL
frgo has quit [Remote host closed the connection]
psilotorp has joined #lisp
<phoe> (multiple-value-call #'+ (values 1 2 3)) ;=> 6
<phoe> note that #'+ is a regular function
frgo has joined #lisp
<phoe> it's multiple-value-call that does all the magic
<engblom> Thanks!
rgherdt_ has quit [Ping timeout: 260 seconds]
<kagevf> that's interesting ... so (m-v-c fn (values ...)) is like (apply fn (list ...)) ??
<Bike> yes.
<engblom> I am looking at https://github.com/keithj/alexandria/blob/master/package.lisp. Why do all the exported functions got #:function-name instead of just :function-name?
<Bike> the things in defpackage are string designators, so symbols have no meaning beyond their symbol name, so #:f and :f are the same to defpackage
<Bike> the only difference is that with #:f there will not be a symbol interned in the keyword package
kevingal has quit [Remote host closed the connection]
Oddity has quit [Ping timeout: 246 seconds]
<engblom> I am sorry, but I can not comprehend that. What is the keyword package?
<Bike> When you write :foo that is short for keyword:foo
<Bike> keyword is a special package. all the symbols in it are constants with themselves as values. that's why if you put :foo in the repl you get :foo back.
<kagevf> you can also do (multiple-value-call #'+ 1 2 3) ... m-v-c will take all the values of any forms ... it's like it does the (values ...) for you
<kagevf> nice flexibility
<engblom> Bike: :foo
<engblom> Unknown top-level command: "foo".
<Bike> uhhhhh, what implementation is that?
<engblom> sbcl
<Bike> are you in the debugger or something?
<Bike> i just started a fresh sbcl in terminal and it did what i'd expect
<engblom> No, I am not in the debugger
<engblom> But I am inside of a package, if that matters?
<pjb> yeah, sbcl debugger is a little psychopathic.
<Bike> it shouldn't
<pjb> This is why slime sldb was developped…
<Bike> the repl is trying to interpret forms as commands for some reason
<Bike> well, you can do (eval :foo), probably, to get the same idea
<engblom> That works.
<pjb> Well, (eval ':foo) to be sure.
<pjb> Since eval is a function :foo would be evaluated before its value being passed to eval…
<engblom> But what is #:foo then?
<pjb> (let ((x '#:foo)) (setf (symbol-value x) 42) (eval x)) #| --> 42 |#
Oddity has joined #lisp
<Nilby> sbcl debugger doesn't do that
<pjb> Or: (progn (setf (symbol-value '#1=#:foo) 42) (eval '#1#)) #| --> 42 |#
orivej has joined #lisp
mindCrime has quit [Ping timeout: 265 seconds]
<Nilby> ccl debuger does though
<pjb> correct.
<pjb> sorry.
<Bike> #:foo is an uninterned symbol
<Bike> meaning it's not in any package
orivej has quit [Ping timeout: 260 seconds]
orivej_ has joined #lisp
TK__ has joined #lisp
jnewton`` has quit [Ping timeout: 240 seconds]
davisr__ has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
davisr_ has quit [Remote host closed the connection]
hiruji has joined #lisp
igemnace has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 240 seconds]
acolarh has quit [Ping timeout: 252 seconds]
kmeow has quit [Quit: Leaving]
akanouras has quit [Ping timeout: 258 seconds]
etimmons has quit [Ping timeout: 258 seconds]
johnjay has quit [Ping timeout: 252 seconds]
loke[m] has quit [Ping timeout: 258 seconds]
MrtnDk[m] has quit [Ping timeout: 245 seconds]
johnjay has joined #lisp
acolarh has joined #lisp
jnewton`` has joined #lisp
brandfla` has joined #lisp
brandflake11 has quit [Ping timeout: 245 seconds]
jaquatix_ has quit [Quit: Leaving]
pfdietz has quit [Ping timeout: 240 seconds]
srhm has quit [Quit: Konversation terminated!]
etimmons has joined #lisp
akanouras has joined #lisp
loke[m] has joined #lisp
abhixec has joined #lisp
Stanley00 has joined #lisp
Stanley00 has quit [Remote host closed the connection]
mindCrime has joined #lisp
MrtnDk[m] has joined #lisp