jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.5.4, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
smazga has quit [Quit: leaving]
LiamH has quit [Quit: Leaving.]
Bike has joined #lisp
Bourne has quit [Ping timeout: 250 seconds]
ljavorsk has quit [Ping timeout: 268 seconds]
hiroaki has quit [Ping timeout: 268 seconds]
torbo has joined #lisp
anewuser has joined #lisp
anewuser has quit [Ping timeout: 250 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
elfmacs has joined #lisp
bitmapper has quit [Ping timeout: 276 seconds]
port1024 has quit [Quit: Leaving]
clothespin has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
orivej has quit [Ping timeout: 276 seconds]
Inline has quit [Ping timeout: 264 seconds]
Inline__ has joined #lisp
patlv_ has joined #lisp
zotan has joined #lisp
amerigo has quit [Quit: Connection closed for inactivity]
karswell has quit [Ping timeout: 268 seconds]
Lord_of_Life_ has joined #lisp
EvW1 has quit [Ping timeout: 250 seconds]
Lord_of_Life has quit [Ping timeout: 268 seconds]
Lord_of_Life_ is now known as Lord_of_Life
omarish has joined #lisp
slyrus has joined #lisp
slyrus_ has quit [Ping timeout: 240 seconds]
mikecheck has quit [Ping timeout: 240 seconds]
X-Scale has quit [Ping timeout: 265 seconds]
iovec has quit [Quit: Connection closed for inactivity]
patlv_ has quit [Ping timeout: 265 seconds]
X-Scale has joined #lisp
earl-ducaine_ has joined #lisp
ebrasca has quit [Remote host closed the connection]
efm has joined #lisp
FreeBirdLjj has joined #lisp
X-Scale has quit [Ping timeout: 268 seconds]
X-Scale` has joined #lisp
X-Scale` is now known as X-Scale
akoana has left #lisp ["Leaving"]
enrio has joined #lisp
nchamber- is now known as nchambers
FreeBirdLjj has quit [Ping timeout: 250 seconds]
jeosol has joined #lisp
omarish has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rudolph is now known as uplime
joinr has joined #lisp
<joinr> Is it expected behavior that using varargs within a recursive labels form will cause an infinite loop?
<joinr> given:
<joinr> (defun f (&rest args) (LABELS ((aux (X &REST XS) (PROGN (IF (not (null xs)) (PROGN (PPRINT X) (aux (FIRST XS) (rest XS))))))) (apply #'aux args)))
<no-defun-allowed> varargs?
<joinr> &rest
<joinr> ugh, sorry, formatting is off..
<no-defun-allowed> Well, there's no requirement for tail recursion to work in CL.
<joinr> if I invoke that with (f 0 1 2 3 4 5 6) on either sbcl or clisp
<joinr> I get a infinite recursion.
<joinr> tail or no
<no-defun-allowed> Or do you mean that it never returns?
<joinr> expectation is that the null condition will be met eventually and computation stops. Instead, you get Nil printing out
uplime has left #lisp ["/me scurries away"]
<joinr> expectation for the input would be, printing the numbers 0 to 6 then return
<joinr> this is a small reproducible case for a larger metprogramming deal. I thought labels would work fine (and it does) seemingly as long as you don't go into &rest arg territory and try to apply.
<Bike> you have (aux (first xs) (rest xs))
<Bike> so you're always calling aux with two arguments
<Bike> so xs is never null
<joinr> ah...
<joinr> so I need to apply within the body?
<Bike> you meant (apply #'aux (first xs) (rest xs)), probably
<no-defun-allowed> Is there a -- oh, yeah, that's probably important.
omarish has joined #lisp
<joinr> beautiful, thanks for the eyes.
<Bike> or just (apply #'aux xs) i guess
<no-defun-allowed> I'm not sure if you intend for this to happen, but (f 0) will print nothing.
<Bike> yeah it drops the last value
<Bike> dunno why so i'm gonna leave it as an exercise to ze reader
<joinr> this is more of a toy problem, the exact behavior isn't as interesting though.
<Bike> oh, no, i get it
<joinr> the non-terminating phenomena was what got me. totally forgot I'd have to apply on recurse.
<joinr> which works
malfort has joined #lisp
lottaquestions has joined #lisp
<lottaquestions> Hi all, is there a way of listing all the global variables in a running instance in slime?
earl-ducaine_ has quit [Ping timeout: 265 seconds]
patrixl has joined #lisp
<Bike> Sort of. You can do (let (c) (do-all-symbols (s c) (when (boundp s) (push s c))))
<Bike> On my system there are 5493, so be careful
<Bike> technically there could also be variables named by inaccessible symbols, but that doesn't happen much
wiselord has quit [Ping timeout: 268 seconds]
<lottaquestions> thanks. Worth a try
<no-defun-allowed> (do-symbols (s) (when (and (boundp s) (eql (symbol-package s) package)) (print s))) will print all the symbols that are bound in the current package, which isn't all of them, but might be what you want.
Dibejzer has joined #lisp
Dibejzer has quit [Client Quit]
omarish has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
omarish has joined #lisp
omarish has quit [Client Quit]
buffergn0me has joined #lisp
sjl has quit [Ping timeout: 276 seconds]
dan64 has quit [Ping timeout: 276 seconds]
enrioog has joined #lisp
enrio has quit [Ping timeout: 268 seconds]
shifty has joined #lisp
wiselord has joined #lisp
elfmacs has quit [Ping timeout: 252 seconds]
slyrus_ has joined #lisp
slyrus has quit [Ping timeout: 268 seconds]
gravicappa has joined #lisp
lottaquestions has quit [Remote host closed the connection]
joinr has quit [Ping timeout: 260 seconds]
Bike has quit [Quit: Lost terminal]
ggole has joined #lisp
libertyprime has joined #lisp
slyrus_ has quit [Ping timeout: 240 seconds]
vaporatorius has quit [Ping timeout: 268 seconds]
zaquest has quit [Quit: Leaving]
enrioog has quit [Ping timeout: 276 seconds]
vaporatorius has joined #lisp
efm has quit [Remote host closed the connection]
efm has joined #lisp
wiselord has quit [Ping timeout: 240 seconds]
vaporatorius has quit [Read error: Connection reset by peer]
<beach> Good morning everyone!
malfort_ has joined #lisp
malfort has quit [Ping timeout: 252 seconds]
torbo has quit [Remote host closed the connection]
dddddd has quit [Ping timeout: 250 seconds]
ebzzry has quit [Ping timeout: 265 seconds]
xkapastel has joined #lisp
toorevitimirp has joined #lisp
Inline__ has quit [Quit: Leaving]
nullniverse has quit [Ping timeout: 268 seconds]
saravia has joined #lisp
wiselord has joined #lisp
nullniverse has joined #lisp
sauvin has joined #lisp
elfmacs has joined #lisp
<beach> jackdaniel: Thanks for the link to Graham's article. He seems to put his finger on something important.
Bourne has joined #lisp
vlatkoB has joined #lisp
wiselord has quit [Read error: Connection reset by peer]
wiselord has joined #lisp
libertyprime has quit [Read error: Connection reset by peer]
brown121408 has quit [Ping timeout: 245 seconds]
brown121408 has joined #lisp
slyrus has joined #lisp
toorevitimirp has quit [Remote host closed the connection]
<boeg> beach: mornings!
orivej has joined #lisp
<boeg> second day with sick kid at home, keeping me up all night. Think I'm gonna see if I can optimize on my advent of code adventure from yesterday
Duuqnd has quit [Ping timeout: 246 seconds]
varjag has joined #lisp
<beach> Sounds good.
elfmacs has quit [Ping timeout: 265 seconds]
dale has quit [Quit: My computer has gone to sleep]
malfort_ has quit [Ping timeout: 240 seconds]
elfmacs has joined #lisp
saravia has quit [Remote host closed the connection]
Cymew has quit [Ping timeout: 245 seconds]
scymtym has quit [Ping timeout: 265 seconds]
JohnMS_WORK has joined #lisp
Cymew has joined #lisp
Cymew has quit [Read error: Connection reset by peer]
Cymew has joined #lisp
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
vaporatorius has joined #lisp
elfmacs has quit [Ping timeout: 268 seconds]
Lycurgus has joined #lisp
wiselord has quit [Ping timeout: 268 seconds]
elfmacs has joined #lisp
Duuqnd has joined #lisp
Davd33 has joined #lisp
Davd33 has quit [Remote host closed the connection]
frgo has quit [Ping timeout: 240 seconds]
thonkpod has quit [Ping timeout: 245 seconds]
thonkpod has joined #lisp
<boeg> Is there a built in like `intersection` for lists, but for hash tables?
<boeg> testing for the key being in both hash tables, not the content
xkapastel has quit [Quit: Connection closed for inactivity]
<Shinmera> no
Lycurgus has quit [Quit: https://meansofproduction.biz Exit Quassel.]
scymtym has joined #lisp
<boeg> Shinmera: Alright, thanks
elfmacs has quit [Ping timeout: 268 seconds]
bendersteed has joined #lisp
frgo has joined #lisp
elfmacs has joined #lisp
xkapastel has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
bendersteed has quit [Client Quit]
bendersteed has joined #lisp
amerigo has joined #lisp
frgo has joined #lisp
buffergn0me has quit [Ping timeout: 250 seconds]
nowhere_man has quit [Ping timeout: 245 seconds]
quazimodo has quit [Read error: Connection reset by peer]
quazimodo has joined #lisp
quazimodo has quit [Read error: Connection reset by peer]
jonatack has quit [Ping timeout: 276 seconds]
quazimodo has joined #lisp
quazimodo has quit [Read error: Connection reset by peer]
ebrasca has joined #lisp
quazimodo has joined #lisp
ralt has joined #lisp
<ralt> so uh
<ralt> did anyone write some ECL funsies to write emacs modules in CL? http://diobla.info/blog-archive/modules-tut.html
<phoe> no idea if that's been done, #ecl might know
enrio has joined #lisp
bendersteed has quit [Remote host closed the connection]
bendersteed has joined #lisp
bendersteed has quit [Remote host closed the connection]
frgo has quit [Remote host closed the connection]
quazimodo has quit [Read error: Connection reset by peer]
hhdave has joined #lisp
buffergn0me has joined #lisp
buffergn0me has quit [Read error: Connection reset by peer]
mathrick has quit [Ping timeout: 268 seconds]
quazimodo has joined #lisp
quazimodo has quit [Read error: Connection reset by peer]
frgo has joined #lisp
quazimodo has joined #lisp
quazimodo has quit [Read error: Connection reset by peer]
dkrm has quit [Quit: WeeChat 2.5]
lavaflow has joined #lisp
frgo_ has joined #lisp
frgo has quit [Ping timeout: 240 seconds]
frgo_ has quit [Read error: Connection reset by peer]
frgo has joined #lisp
quazimodo has joined #lisp
Davd33 has joined #lisp
quazimodo has quit [Read error: Connection reset by peer]
frgo has quit [Ping timeout: 250 seconds]
Davd33 has quit [Remote host closed the connection]
dkrm has joined #lisp
gxt has quit [Remote host closed the connection]
jonatack has joined #lisp
gxt has joined #lisp
quazimodo has joined #lisp
Davd33 has joined #lisp
quazimodo has quit [Read error: Connection reset by peer]
<boeg> if I have a hash table `hash-t` and two variables `key-a` and `key-b` bound to `(cons 1 0)` and I do `setf (gethash key-a hash-t) 1)` why can't I do `(gethash key-b hash-t)` to access the value stored at `key-a`? My guess is that the key where I stored the `1` is a reference to the `key-a` variable, and so even though `key-b` contains a similar looking cons, it's not the same, so it doesn't work, but how do I make it work?
quazimodo has joined #lisp
jonatack_ has joined #lisp
<no-defun-allowed> EQ and EQL will not work, and EQUAL and EQUALP will.
bendersteed has joined #lisp
<boeg> right, maybe I should check again, because I blindly tried telling gethash to use equal with `:test #'equal` but it didn't work and I just ... yeah, take a look at the documentation again :)
jonatack has quit [Ping timeout: 268 seconds]
<no-defun-allowed> Yeah, the tests have to be provided in MAKE-HASH-TABLE.
<boeg> no-defun-allowed: oh, alright, thanks
makomo has quit [Ping timeout: 250 seconds]
grabarz has joined #lisp
Davd33 has quit [Remote host closed the connection]
heisig has joined #lisp
ironbutt has joined #lisp
shifty has quit [Ping timeout: 240 seconds]
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
wiselord has joined #lisp
<pjb> clhs equal
<pjb> (equal (cons 1 0) (cons 1 0)) #| --> t |#
<boeg> pjb: indeed - problem was I hadn't configured the hash-table to use it
<boeg> pjb: it's working and my advent of code is now speedy
<boeg> went from maybe 5+ minutes to sub zero second
pilne has quit [Quit: Light travels faster then sound, which is why some people appear bright, until you hear them speak]
<pjb> Good.
xkapastel has quit [Quit: Connection closed for inactivity]
<boeg> yes i feel like advent of code is a good way to learn a language for me
elfmacs has quit [Ping timeout: 276 seconds]
<boeg> It throws you around in corners you wouldn't have thought of yourself. I have been reading practical common lisp and land of lisp a bit, but there's nothing like real experience, even though advent of code is taking me soo much longer compared to if I was doing it in a language I know better
elfmacs has joined #lisp
gxt has quit [Remote host closed the connection]
gxt has joined #lisp
Guest75462 has quit [Read error: Connection reset by peer]
Guest75462 has joined #lisp
Kevslinger has quit [Quit: Connection closed for inactivity]
<heisig> Speaking of advent of code - anyone interested in sharing solutions? Here are mine: https://github.com/marcoheisig/adventofcode
amerigo has quit [Quit: Connection closed for inactivity]
<no-defun-allowed> Morning heisig
kritixilithos has joined #lisp
<no-defun-allowed> Should I start doing those kind of problem sets? Usually I find approaching whatever comes to mind more enjoyable, but I've heard several times that usually those tend to not be unfamiliar or difficult.
m00natic has joined #lisp
smokeink has joined #lisp
nullniverse has quit [Remote host closed the connection]
ljavorsk has joined #lisp
cosimone has joined #lisp
mathrick has joined #lisp
<jackdaniel> beach: sure
jeosol has quit [Remote host closed the connection]
pfdietz has quit [Remote host closed the connection]
harold6841 has joined #lisp
harold6841 has quit [Remote host closed the connection]
brown121408 has quit [Read error: Connection reset by peer]
brown121408 has joined #lisp
ebrasca has quit [Remote host closed the connection]
_whitelogger has joined #lisp
akoana has joined #lisp
earl-ducaine has quit [Ping timeout: 268 seconds]
cosimone has quit [Quit: Quit.]
cosimone has joined #lisp
JohnMS has joined #lisp
JohnMS_WORK has quit [Ping timeout: 265 seconds]
earl-ducaine has joined #lisp
mathrick has quit [Read error: Connection timed out]
mathrick has joined #lisp
cosimone has quit [Quit: Quit.]
<boeg> So whats a good source for how to set up a common lisp project? Right now I just create .lisp files and manually use quickload to load dependencies - well, dependency, I have only used a single library yet, split-sequence :P - but I was thinking if theres a good source to create a project for my advent of code project where I can have it handle bringing in split-sequence and so on
<pjb> create an asd file and quickload it!
<earl-ducaine> boeg: are you using quicklisp?
<boeg> yes, I have been using quickload, earl-ducaine
<_death> http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/ see section titled "Systems"
<earl-ducaine> boeg: You'll find all the sources of the projects that used at: quicklisp/dists/quicklisp/software/
<boeg> pjb: ill check that out
<earl-ducaine> boeg: each one will have at least one *.asdf so you'll have a bunch of examples of how to write them.
<boeg> _death: thanks, ill check it out
bitmapper has joined #lisp
<boeg> earl-ducaine: alright, thanks!
enrio has quit [Read error: Connection reset by peer]
<earl-ducaine> boeg: ASDF has a comprehensive manual, so you should get that. But a warning, it's quite terse.
enrio has joined #lisp
<boeg> earl-ducaine: I'm checking out the stevelosh article right now, and then I'll see afterwards if i'm still missing things :)
<earl-ducaine> boeg: It has few examples and for stupid people like myself it can be frusterating to use on its own.
Davd33 has joined #lisp
JohnMS has quit [Read error: Connection reset by peer]
mathrick has quit [Quit: Leaving]
<earl-ducaine> boeg: one thing that you'll find quite convenient once you have your ASDF project set up is creating a symbolic filesystem link to it at: quicklisp/local-projects/
JohnMS has joined #lisp
mathrick has joined #lisp
<earl-ducaine> boeg: Then you'll be able to load it using quicklisp! e.g. (ql:quickload :my-new-project)
<boeg> earl-ducaine: interesting, thanks!
<boeg> ill see if I can figure it out :P
Davd33 has quit [Remote host closed the connection]
lucasb has joined #lisp
Davd33 has joined #lisp
jfb4 has joined #lisp
frgo has quit [Remote host closed the connection]
jfb4_ has quit [Ping timeout: 246 seconds]
akoana has quit [Quit: leaving]
Davd33 has quit [Remote host closed the connection]
wxie has joined #lisp
smokeink has quit [Ping timeout: 265 seconds]
sz0 has joined #lisp
mathrick has quit [Ping timeout: 268 seconds]
scymtym has quit [Remote host closed the connection]
jonatack_ has quit [Ping timeout: 240 seconds]
scymtym has joined #lisp
random-nick has joined #lisp
wxie has quit [Ping timeout: 245 seconds]
amerlyq has joined #lisp
_jrjsmrtn has quit [Ping timeout: 265 seconds]
__jrjsmrtn__ has joined #lisp
anewuser has joined #lisp
SaganMan has joined #lisp
jfb4_ has joined #lisp
kaun_ has joined #lisp
jfb4 has quit [Ping timeout: 268 seconds]
ebzzry has joined #lisp
patlv_ has joined #lisp
kaun_ has quit [Quit: Erc off!]
adolby has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
adolby has joined #lisp
omarish has joined #lisp
skeuomorf has joined #lisp
sjl_ has quit [Ping timeout: 268 seconds]
heisig has quit [Quit: Leaving]
mingus has joined #lisp
Lord_of_Life_ has joined #lisp
Inline has joined #lisp
Lord_of_Life has quit [Ping timeout: 265 seconds]
Lord_of_Life_ is now known as Lord_of_Life
mathrick has joined #lisp
JohnMS has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
mingus has quit [Remote host closed the connection]
Demosthenex has quit [Ping timeout: 245 seconds]
17SABA2KM has joined #lisp
madmonkey has joined #lisp
brown121408 has quit [Ping timeout: 268 seconds]
jfb4 has joined #lisp
madmonkey has quit [Remote host closed the connection]
madmonkey has joined #lisp
jfb4_ has quit [Ping timeout: 276 seconds]
EvW has joined #lisp
makomo has joined #lisp
Duuqnd has quit [Ping timeout: 276 seconds]
Bike has joined #lisp
Demosthenex has joined #lisp
Kevslinger has joined #lisp
Demosthenex has quit [Ping timeout: 268 seconds]
pfdietz has joined #lisp
patlv_ has quit [Ping timeout: 240 seconds]
clothespin has quit [Ping timeout: 250 seconds]
Lycurgus has joined #lisp
skeuomorf has quit [Ping timeout: 265 seconds]
spal has joined #lisp
didi has joined #lisp
<didi> Can I control what `read-line' interprets as a newline?
<dlowe> didi: not really
<didi> dlowe: Bummer.
<dlowe> writing your own read-until-char is pretty easy
<dlowe> now that would be a good addition to alexandria, were they making additions
mathrick has quit [Read error: Connection timed out]
<didi> dlowe: I might, tho it needs to read until a sequence of two chars.
<dlowe> didi: are you parsing \r\n?
mathrick has joined #lisp
<didi> dlowe: That too. Input files be crazy.
<dlowe> read-until-string would be good too
LiamH has joined #lisp
<didi> Each tabulated data file use a different convention to separate records, fields, to escape characters...
ArthurStrong has joined #lisp
<dlowe> yeah, well, that's why everyone got excitable over xml when it came out
<dlowe> as awful as it was, it was nice to have something standard with momentum behind it
<didi> dlowe: Agreed. Tho there is a lot of broken XML out there. Also, they love JSON now.
ljavorsk has quit [Ping timeout: 268 seconds]
<dlowe> web folks love JSON, business folks still love XML AFAIK, but yeah, no one respected XML enough to use the encoders.
<White_Flame> s/love/'need'/
<dlowe> "are compelled (for reasons) to use"
monokrom has joined #lisp
<White_Flame> because they're compelled and don't actually love it, they don't care about implementing it properly
sz0 has quit [Quit: Connection closed for inactivity]
<dlowe> I disagree with your causation. I think caring about proper implementation is only weakly correlated.
spal has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
mathrick has quit [Read error: Connection timed out]
mathrick has joined #lisp
<White_Flame> could be, but that's the source of a lot of "respecting" the XML spec
<White_Flame> *lack of
<pfdietz> I find myself using json quite a bit even in lisp.
grewal has quit [Ping timeout: 276 seconds]
grewal__ has joined #lisp
spal has joined #lisp
<dlowe> the other source is that C++ libraries for emitting XML were (and perhaps still are) crazy terrible
<dlowe> you can make a much nicer thing in lisp
<dlowe> (encode-xml `(taggy :mc "data" (mctagface "moar data")))
<White_Flame> yep, I've done simple HTML encoders from scratch, since they're like 10 linues
<White_Flame> *lines
<didi> White_Flame: Did you try writing HTML decoders? Path to madness.
<_death> you can use flexi-streams's :eol-style
<didi> _death: Thank you.
dale_ has joined #lisp
dale_ is now known as dale
mathrick has quit [Ping timeout: 245 seconds]
<didi> Those who say "don't use regular expressions to parse html" are only partially correct. HTML in the wild is a total mess.
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
<phoe> if lispers closed parens as consistently as html writers closed tags then Lisp would fail to compile in 99 cases out of 98
AnimalClatter has joined #lisp
Demosthenex has joined #lisp
<boeg> lol
milanj has joined #lisp
frgo has joined #lisp
<dlowe> didi: I think the advice is actually to use a library (i.e. someone else's regular expressions) to parse html
slyrus_ has joined #lisp
slyrus has quit [Ping timeout: 240 seconds]
grewal_ has quit [Ping timeout: 252 seconds]
grewal has joined #lisp
oni-on-ion has joined #lisp
Ven`` has joined #lisp
gareppa has joined #lisp
bitmapper has quit [Ping timeout: 250 seconds]
<White_Flame> didi: yeah, decoding HTML is left to the browser ;)
clothespin has joined #lisp
gareppa has quit [Remote host closed the connection]
dddddd has joined #lisp
mfiano2 has joined #lisp
bitmapper has joined #lisp
vms14 has joined #lisp
FreeBirdLjj has joined #lisp
DGASAU has quit [Read error: Connection reset by peer]
efm has quit [Read error: Connection reset by peer]
DGASAU has joined #lisp
rustik has joined #lisp
mathrick has joined #lisp
efm has joined #lisp
AnimalClatter has quit [Ping timeout: 265 seconds]
t58 has joined #lisp
AnimalClatter has joined #lisp
orivej has quit [Ping timeout: 268 seconds]
jonatack has joined #lisp
AnimalClatter has quit [Write error: Connection reset by peer]
17SABA2KM has quit [Read error: Connection reset by peer]
brown121407 has joined #lisp
rustik has quit [Read error: Connection reset by peer]
rustik has joined #lisp
AnimalClatter has joined #lisp
rustik has quit [Read error: Connection reset by peer]
elfmacs has quit [Ping timeout: 246 seconds]
rustik has joined #lisp
Cymew has quit [Ping timeout: 268 seconds]
AnimalClatter has quit [Ping timeout: 268 seconds]
clothespin has quit [Ping timeout: 250 seconds]
rgherdt has joined #lisp
AnimalClatter has joined #lisp
<Shinmera> The call for papers for ELS20 is now online! https://european-lisp-symposium.org/2020/index.html
anewuser has quit [Quit: anewuser]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rustik has quit [Read error: Connection reset by peer]
rustik has joined #lisp
rustik has quit [Read error: Connection reset by peer]
<vms14> Guys I want to rotate a list, but rotatef does not really "rotate" it just switches positions. I'm using (cons (car (last the-list))) + (remove (car (last the-list)))
<vms14> it works, but there is a better way to do it?
rustik has joined #lisp
AnimalCl` has joined #lisp
<vms14> I'm trying to make the snake game and the snake is just a list of points, to move the snake, I want to rotate the last item so the last part of the tail will be the head
Ven`` has joined #lisp
<Bike> you can use butlast instead of remove.
bitmapper has quit [Remote host closed the connection]
<vms14> ty bike <3
rustik has quit [Read error: Connection reset by peer]
<Bike> this is not really an efficient operation to do on lists, though.
<vms14> how would be efficient?
rustik has joined #lisp
<vms14> consing is not good anyway
<vms14> (setf oh (cons (car (last oh)) (remove (car (last oh)) oh)))
<vms14> this is what I'm doing
<vms14> but I don't like that and idk why
<Bike> well you compute LAST twice, and you use REMOVE even though you only want one element removed
<oni-on-ion> iCons
<dlowe> vms14: construct a circular list?
<Bike> oh, good idea
AnimalClatter has quit [Ping timeout: 265 seconds]
<vms14> never made a circular list, I'll try, ty dlowe
bbsl has joined #lisp
<vms14> oh I did one while looking at the land of lisp book I guess
rustik has quit [Read error: Connection reset by peer]
rustik has joined #lisp
davepdotorg has quit [Remote host closed the connection]
<vms14> works fine
cosimone has joined #lisp
<vms14> thanks dlowe, I guess I'll use that and just update the list every time I push a new item
clothespin has joined #lisp
<vms14> well idk if will work or I'll have troubles while pushing stuff into a circular list
<beach> You just have to be careful what you are doing.
<vms14> should I save the list before making it circular? so to push stuff I can update the saved list
<dlowe> pushing stuff onto a circular list means adding it after the head
rgherdt has quit [Ping timeout: 250 seconds]
<beach> So you can use (push ... (cdr list))
<beach> ... or to some later point of course.
smazga has joined #lisp
rustik has quit [Read error: Connection reset by peer]
<vms14> thanks for the advices
<vms14> it looks much better than setf cons + remove + using last twice
<beach> Here is another piece of advice for you: "advice" does not take a plural form. It is like a substance in English. In singular, it would be "a piece of advice". :)
<vms14> thanks, I really need those corrections
<vms14> people just let me kick the English dictionary and they say nothing, but this way I'll never learn
<beach> I am glad this is your attitude.
<vms14> I like to learn and improve
<clothespin> beach: any progress on second climacs?
<vms14> this is why I come here to ask stuff
EvW has quit [Ping timeout: 245 seconds]
<beach> clothespin: Nothing substantial. I have been giving some thought to how to compute indentation, which is why I suspended development on it. But I am mostly working on SICL now.
Lycurgus has quit [Quit: https://meansofproduction.biz Exit Quassel.]
AnimalCl` has quit [Remote host closed the connection]
AnimalCl` has joined #lisp
<clothespin> beach: don't abandon it
zmv has joined #lisp
<beach> I won't.
rustik has joined #lisp
AnimalCl` has quit [Remote host closed the connection]
AnimalCl` has joined #lisp
vms14 has quit [Remote host closed the connection]
rustik has quit [Read error: Connection reset by peer]
FreeBirdLjj has quit [Remote host closed the connection]
rustik has joined #lisp
FreeBirdLjj has joined #lisp
rustik has quit [Read error: Connection reset by peer]
rustik has joined #lisp
AnimalCl` has quit [Read error: Connection reset by peer]
AnimalCl` has joined #lisp
AnimalCl` has quit [Remote host closed the connection]
AnimalCl` has joined #lisp
rustik has quit [Read error: Connection reset by peer]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
orivej has joined #lisp
rustik has joined #lisp
rustik has quit [Excess Flood]
earl-ducaine_ has joined #lisp
grabarz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pjb> minion: memo for vms14: you can rotate a list in a user friendly way with two rotatef: https://pastebin.com/32mSuwkr
<minion> Remembered. I'll tell vms14 when he/she/it next speaks.
mathrick has quit [Ping timeout: 250 seconds]
<jasom> I assume nobody is working on a port of SBCL to windows/arm64?
earl-ducaine_ has quit [Ping timeout: 268 seconds]
rgherdt has joined #lisp
krisfris has joined #lisp
clothespin has quit [Ping timeout: 268 seconds]
hhdave has quit [Quit: hhdave]
rippa has joined #lisp
AnimalCl` has quit [Ping timeout: 240 seconds]
AnimalCl` has joined #lisp
awolven has joined #lisp
patlv_ has joined #lisp
makomo has quit [Quit: WeeChat 2.4]
jmercouris has joined #lisp
<Shinmera> jasom: not enough people are working on win/amd64 to begin with
awolven has quit [Remote host closed the connection]
m00natic has quit [Remote host closed the connection]
patlv_ has quit [Ping timeout: 265 seconds]
mathrick has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
clothespin has joined #lisp
J_J_1 has joined #lisp
Necktwi has quit [Ping timeout: 268 seconds]
kritixilithos has quit [Quit: quit]
AnimalCl` has quit [Remote host closed the connection]
AnimalCl` has joined #lisp
FreeBirdLjj has quit [Ping timeout: 250 seconds]
davepdotorg has joined #lisp
travv0` has joined #lisp
davepdotorg has quit [Ping timeout: 265 seconds]
mathrick_ has joined #lisp
mathrick has quit [Ping timeout: 276 seconds]
zmv has quit [Read error: Connection reset by peer]
z3t0 has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
z3t0 has joined #lisp
vhost- has quit [Quit: WeeChat 2.6]
khisanth__ has quit [Ping timeout: 265 seconds]
xkapastel has joined #lisp
vhost- has joined #lisp
vms14 has joined #lisp
ggole has quit [Quit: Leaving]
mathrick__ has joined #lisp
milanj has quit [Quit: Leaving]
khisanth__ has joined #lisp
mathrick_ has quit [Ping timeout: 252 seconds]
travv0` has left #lisp ["ERC (IRC client for Emacs 25.2.2)"]
mathrick_ has joined #lisp
beach` has joined #lisp
mathrick__ has quit [Ping timeout: 268 seconds]
AnimalCl` has quit [Ping timeout: 252 seconds]
beach has quit [Disconnected by services]
reepca has joined #lisp
beach` is now known as beach
<vms14> minion tell me
<minion> vms14, memo from pjb: you can rotate a list in a user friendly way with two rotatef: https://pastebin.com/32mSuwkr
<vms14> pjb: the link died
<vms14> xD
whiteline has quit [Remote host closed the connection]
<pjb> Already?
Dibejzer has joined #lisp
<vms14> not, sorry my bad
Dibejzer has quit [Client Quit]
<vms14> thanks for this code
<reepca> is there an equivalent to make-string-output-stream but for writing bytes instead of characters?
whiteline has joined #lisp
jmercouris has quit [Ping timeout: 268 seconds]
buffergn0me has joined #lisp
<vms14> reepca: you can make a "normal stream" and choose the element type you want
<vms14> To read the raw bytes, you need to pass OPEN an :element-type argument of '(unsigned-byte 8).
izh_ has joined #lisp
<Bike> reepca: I think the flexi-streams library provides this.
MichaelRaskin has joined #lisp
<pjb> reepca: there is, but do you realize that you can just as well and even more efficiently just write into a vector?
<pjb> (let ((output (make-array 1024 :element-type '(unsigned-byte 8)))) (setf (aref output 0) 42) (replace output #(1 2 3) :start1 1) etc… output)
port1024 has joined #lisp
<vms14> pjb: I guess I'll use your approach instead of a circular list
<vms14> I'm not sure, but I think with a circular list I'll need to save the list before being circular, or remove the last element any time I'll update it
buffergn0me has quit [Remote host closed the connection]
buffergn0me has joined #lisp
EvW1 has joined #lisp
<pjb> vms14: walking a circular list is the fastest. What do you want to do exactly?
sauvin has quit [Read error: Connection reset by peer]
<vms14> pjb: oh
<pjb> vms14: alternatively, using a vector is fast too.
<vms14> and even easier
<vms14> I want to make the snake game
<vms14> but the snake movement is really a bit of fake
<vms14> instead of moving all the "points" you just make the last point of the tail be the head
<vms14> this is why I want to rotate a list
<pjb> Since there is a maximum snake length, you could use a vector, and too indices (head tail).
<vms14> the snake then only moves one point, instead of the whole body
vlatkoB has quit [Remote host closed the connection]
<pjb> s/too/two/ of course.
<pjb> An alternate representation is to use the board itself to represent the snake.
gravicappa has quit [Ping timeout: 250 seconds]
<pjb> A cell can contain a code to represent empty apple and the various possible snake sections. (up down) (up left) (up right) … (down left) (head up) (head down) … (tail right) (tail left).
whiteline has quit [Read error: Connection reset by peer]
whiteline has joined #lisp
<pjb> So to find the snake you only need the head and tail coordinates, and you can know what cell to update by using the code for the from/to cells.
<vms14> I like that, but not for the snake case
<vms14> I really only need to check for collision with the head
<vms14> and the snake can be just a list of points
<vms14> well, not true that I only need to check the head
<pjb> Obviously when we have gigabytes of RAM, nothing matters much anymore. It would be different in 1KB :-)
<vms14> I like what you say about having everything in the board directly, so every cell has a value. I had this in mind for another game
<vms14> but for the snake I think is even easier to have a list of points being the snake, and check those points
srji has joined #lisp
<vms14> for moving I only need to rotate the last element so it will be the first (head) and 1+ point-x for example if it moves to the right
<vms14> first-point-x *
<pjb> vms14: this solution would work well for very big boards. With 5K screens, you could easily go up to (640 360) cells.
<pjb> So instead of pre-allocating 230K cells, you would just have a list of apples, and grow a list for the snake; the user will probably fail long before reaching a 230K cell long snake.
<vms14> xD
<vms14> you're tempting me
<vms14> because I wanted to do that in other game, so it would be a nice opportunity to get used to this approach
<didi> OK, I've hacked a version of `read-until-string'. Resuming.
<pjb> didi: haven't you not considered com.informatimago.common-lisp.cesarum.ascii:read-ascii-line ?
<pjb> right, it's AGPL3 and you're afraid of giving your code…
<didi> pjb: I didn't know about it. Thanks.
<dlowe> discoverability is a thing also
<didi> pjb: I ain't afraid of freedom.
<pjb> Basically, there's everything com.informatimago :-)
<pjb> didi: Just joking, it's funnier to re-implementing things.
<didi> pjb: Agreed.
<dlowe> pjb: you can't blame people without being a hypocrite here :)
varjag has joined #lisp
<dlowe> it's a tough issue to solve for these sorts of quality-of-life utilities
buffergn0me has quit [Ping timeout: 245 seconds]
<jasom> Is there a standard anaphoric prog1? It occurs to me it might be useful for something like (prog1-a (make-array ...) ...)
<pjb> (let ((it (make-array))) (do-something-with it) it)
<jasom> pjb: right.
<pjb> (defmacro with-it (init-form &body body) `(let ((it ,init-form)) ,@body it))
<pjb> (with-it (make-array 10) (setf (aref it 0) 'yo)) #| --> #(yo 0 0 0 0 0 0 0 0 0) |#
bacterio has quit [Read error: Connection reset by peer]
buffergn0me has joined #lisp
bacterio has joined #lisp
cosimone has quit [Quit: Quit.]
Bike has quit [Remote host closed the connection]
entel has quit [Quit: Connection closed for inactivity]
Bike has joined #lisp
ironbutt has quit [Read error: Connection reset by peer]
pfdietz has quit [Remote host closed the connection]
slyrus__ has joined #lisp
nowhere_man has joined #lisp
ironbutt has joined #lisp
slyrus_ has quit [Ping timeout: 250 seconds]
jonatack has quit [Ping timeout: 240 seconds]
buffergn0me has quit [Ping timeout: 250 seconds]
izh_ has quit [Quit: Leaving]
slyrus_ has joined #lisp
efm_ has joined #lisp
efm has quit [Ping timeout: 250 seconds]
slyrus__ has quit [Ping timeout: 268 seconds]
clothespin has quit [Ping timeout: 250 seconds]
buffergn0me has joined #lisp
davepdotorg has joined #lisp
earl-ducaine_ has joined #lisp
davepdotorg has quit [Ping timeout: 250 seconds]
enrio has quit [Ping timeout: 245 seconds]
jmercouris has joined #lisp
Bike has quit [Quit: Bike]
sjl has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
pilne has joined #lisp
hiroaki has joined #lisp
omarish has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<fiddlerwoaroof> I've found that the problem with anaphoric macros is that you have to remember to import IT
shifty has joined #lisp
<pjb> Or that you cannot embed them easily. Better use: (defmacro with (it init-form &body body) `(let ((,it ,init-form)) ,@body ,it))
<pjb> (with this 42 (with that 33 (+ this that))) #| --> 42 |#
<pjb> (with this 42 (with that 33 (print (+ this that)))) #| 75 --> 42 |#
<pjb> So it's better to let the user give the name of the it, in case there is this, that, and thot…
jmercouris has quit [Remote host closed the connection]
jmercouris has joined #lisp
earl-ducaine_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
EvW1 has quit [Ping timeout: 250 seconds]
jonatack has joined #lisp
akoana has joined #lisp
kmeow has joined #lisp
efm_ has quit [Quit: Konversation terminated!]
efm has joined #lisp
didi has left #lisp ["O bella ciao bella ciao bella ciao, ciao, ciao."]
<kmeow> is there a way to put the value of a macro argument into a string?
nowhere_man has quit [Ping timeout: 276 seconds]
bbsl has quit [Remote host closed the connection]
<kmeow> i.e something like (defthing IAC 255) => (defparameter IAC (make-thing :name "IAC" :value 255))
<nirved> (format nil ...)
<nirved> or simpler (string ...)
mathrick_ has quit [Ping timeout: 268 seconds]
<kmeow> hm, weird ... I thought (string) wasn't working for me, but I may have misunderstood the error message
ArthurStrong has quit [Quit: leaving]
<kmeow> okay, so I think my problem is I can't get the macro argument to expand inside "" marks
<kmeow> the macro produces ",name" in other words
slyrus has joined #lisp
<nirved> that's why use format
mathrick_ has joined #lisp
shifty has quit [Ping timeout: 246 seconds]
EvW has joined #lisp
shifty has joined #lisp
slyrus_ has quit [Ping timeout: 240 seconds]
mathrick_ has quit [Ping timeout: 265 seconds]
buffergn0me has quit [Ping timeout: 245 seconds]
mathrick_ has joined #lisp
jmercouris has quit [Remote host closed the connection]
scymtym has quit [Ping timeout: 250 seconds]
<kmeow> I'm getting (format nil "~a" IAC), but I need (format nil "~a" 'IAC), which I haven't yet found a way to do
Ven`` has quit [Quit: Textual IRC Client: www.textualapp.com]
shifty has quit [Ping timeout: 265 seconds]
<nirved> (format nil "~a" `,name)
slyrus_ has joined #lisp
Bike has joined #lisp
slyrus has quit [Ping timeout: 240 seconds]
<pjb> kmeow: you should realize that macros are functions like any other function.
<pjb> kmeow: (defmacro defthing (name value) (let ((sname (string name))) `(list ',name ,sname ,value))) #| --> defthing |# (defthing iac 255) #| --> (iac "IAC" 255) |#
<pjb> kmeow: notice how my *print-case* is set to :downcase. So using format ~A would generate "iac" instead of "IAC". Using string or symbol-name is better if you want to have a consistent case.
<pjb> kmeow: or you can use ~(~A~) or ~:@(~A~).
<pjb> kmeow: nirved solution computes the string at run-time. This might be not what you want.
ebrasca has joined #lisp
scymtym has joined #lisp
bitmapper has joined #lisp
mathrick__ has joined #lisp
mathrick_ has quit [Ping timeout: 265 seconds]
mathrick__ has quit [Ping timeout: 240 seconds]
mathrick__ has joined #lisp
madmonkey has quit [Remote host closed the connection]
<_death> I wonder, does this cffi code make sense to anyone? https://github.com/cffi/cffi/blob/master/src/types.lisp#L562
wiselord has quit [Ping timeout: 265 seconds]
buffergn0me has joined #lisp
<_death> an aggregate-struct-slot has a count, but the methods defined for it take no notice (and foreign-struct-slot-value errors with missing method for translate-aggregate-to-foreign when I trying to use)
davepdotorg has joined #lisp
ineiros has joined #lisp
<phoe> _death: it seems that slot-count is only assigned during the creation of the object.
<phoe> L604 of that file.
<nirved> _death: looks like it's used with libffi
<_death> yes.. there is another reference in cffi-libffi (which I'm using)
davepdotorg has quit [Ping timeout: 276 seconds]
amerlyq has quit [Quit: amerlyq]
kotrcka has joined #lisp
<_death> but given (defcstruct foo (a :int :count 4)) and (defcfun bar :void (foo (:struct foo))), C function void bar(struct foo foo);, a call like (bar (list 'a '(1 2 3 4))) will result in the error I mentioned
Bourne has quit [Remote host closed the connection]
<_death> I could get around it just munging the memory myself.. but it seems like a cffi bug
kotrcka has left #lisp [#lisp]
<Bike> Shinmera: do you actually use extensible sequences? i'm looking for examples of users but github search is as shit as always
buffergn0me has quit [Ping timeout: 245 seconds]
<Shinmera> I have a use for it in Trial
<Shinmera> But nothing else because it's not very widely supported yet.
<Shinmera> I would like to add support for it in FOR and Flare
<Bike> thanks
<Bike> i'm implementing it in clasp (no surprise there) and am wondering about how the actual sequence functions should work. like map and stuff
<Bike> the way sbcl is written, if you map to an extended sequence type, it always calls sequence:map
<Bike> but that pretty much has to cons a lot
<Bike> (well, some)
<Shinmera> why does that have to cons a lot?
<fiddlerwoaroof> I've used them here or there
<Bike> it has to deal with an unknown number of sequences (i.e. a list of sequences), so it conses a list of iterators
<fiddlerwoaroof> e.g. I have a class that represents a RSS or Atom feed and it uses the protocol so you can use remove-if* to filter the items
<Bike> whereas if you do (map 'list f x) it'll pretty much just be dolist
<Shinmera> Bike: ah...
<Shinmera> not sure that can be avoided anyway?
<Bike> well most of the time you call map you're actually writing, you know, like (map ...), so the number of arguments is known at compile time
<Bike> and sbcl open codes it, unless the result is an extended sequence
<Bike> (or probably if optimize space is high)
<Shinmera> Well, the user might provide a more efficient MAP
<_death> https://plaster.tymoon.eu/view/1589#1589 this makes my example work
<Shinmera> is probably why it's not unrolled automatically
<Shinmera> In any case it's too late and my brain is fried, so I don't think I have any useful input on this.
<Bike> that's fine, the example is already helpful
<Bike> there are two different efficiency concerns - this map unrolling biznis, but also the sequence might have some specific ability to be more efficient. if the protocol is such that sequence:map HAS to be called, you only get the latter. if not, only the former
gabiruh has quit [Quit: ZNC - 1.6.0 - http://znc.in]
gabiruh has joined #lisp
clothespin has joined #lisp
LiamH has quit [Quit: Leaving.]
buffergn0me has joined #lisp
<Bike> seeing systems t hat define sequence methods beyond the core and iteration protocol would be interesting. if anyone happens to know any. if they even exist
rgherdt has quit [Quit: Leaving]
<jasom> Does CFFI have a type for a function pointer, or does it just assume that function pointers and data pointers are compatible?
varjag has quit [Ping timeout: 276 seconds]
<fe[nl]ix> the latter
mathrick__ has quit [Ping timeout: 276 seconds]
asarch has joined #lisp
krisfris has quit [Ping timeout: 246 seconds]
mathrick__ has joined #lisp
<_death> seems I got it working.. (bar (list 'a '(1 2 3 4))) => (A (4 3 2 1)) (with bar returning a foo with reversed array contents)
vms14 has quit [Remote host closed the connection]
<_death> I see some cffi tests failing, but it seems some unmodified cffi tests are failing as well
sahara3 has joined #lisp
<sahara3> :-/
ebrasca has quit [Remote host closed the connection]
sahara3 has quit [Ping timeout: 250 seconds]
smazga has quit [Quit: leaving]
ebzzry has quit [Ping timeout: 250 seconds]
ebzzry has joined #lisp
sahara3 has joined #lisp
buffergn0me has quit [Ping timeout: 250 seconds]