jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language<http://cliki.net/> logs:<https://irclog.whitequark.org/lisp,http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.5, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
kozy has quit [Remote host closed the connection]
<makomo> an unrelated but interesting thing is that, theoretically, getting a place's value could yield different results depending on how you get the value: (1) by treating the place as a form or (2) by using code generated by get-setf-expansion
kozy has joined #lisp
<makomo> because (2) might arrange a different order of evaluation that what you would get from (1) by relying on normal left-to-right rules
<makomo> are there any places which you *can't* treat as forms even?
malpas has joined #lisp
<makomo> and if not, are there any for which (1) and (2) don't produce the same results?
<makomo> s/that/than/
<pjb> You mean things that you can put as first argument of setf, but couldn't be used to get an object? Kind of write-only forms?
<makomo> yes, i suppose so
<pjb> I guess you can do it easily with (defun (setf foo) (new-value where) …) without a defun foo.
<makomo> yeah, true, but i was aiming for the standardized ones
<pjb> IIRC, I've done that a couple of times, for write-only slots of some CLOS instances.
<pjb> Not very often.
aleamb has quit [Ping timeout: 250 seconds]
<pjb> AFAICR, not for the standardized ones.
<makomo> mhm
lumm has quit [Quit: lumm]
<pjb> There's very few write-only stuff in CL. IIRC, there must be one or two, but not with accessors.
<pjb> There's the character syntax, that cannot be read IIRC, only copied.
Fare has joined #lisp
groovy2shoes has joined #lisp
malpas has quit [Quit: Leaving]
stacksmith has joined #lisp
siraben has joined #lisp
Fare has quit [Ping timeout: 240 seconds]
Fare has joined #lisp
dented42 has joined #lisp
<aeth> does loop support a loop in a loop?
<aeth> or should a nested loop/mapcar/etc. be used inside of a loop?
<makomo> the latter: (loop ... :do (loop ...))
<aeth> I have an incredibly complicated loop (yes, more than the one from yesterday) because it collects twice, appends twice, and also generates an integer value that's used. https://gitlab.com/zombie-raptor/zombie-raptor/blob/master/entity/entity.lisp#L164-225
<aeth> This loop is better in one big loop than in five different ones
<aeth> It still has a nested mapcar, though.
<pjb> (loop for i in (loop repeat 4 collect 42) for j from 0 collect (loop for k below j collect (list i k))) #| --> (nil ((42 0)) ((42 0) (42 1)) ((42 0) (42 1) (42 2))) |#
<pjb> aeth: a function must do a single thing. Unless you're looping over a multidimensional array, there should be as single loop per function.
<pjb> makomo: ^ too.
<pjb> /makomo: ^ too./d
<aeth> Oh I did find a way to fix my emacs's indentation and clean up yesterday's loop a bit. https://gitlab.com/zombie-raptor/zombie-raptor/blob/b10b0ce00d4c27ec20860991907baae11e188040/util/array.lisp#L113-151
<pjb> aeth: in lisp there are no statements. Therefore you can combine expressions at will!
<aeth> pjb: it is one loop, looping over one list
<aeth> It just makes 5 things from that list and places them in various parts of a macro
<makomo> pjb: true :-)
Fare has quit [Ping timeout: 252 seconds]
<pjb> Notice that if you change it into 5 different loops, it still remains O(n).
<pjb> In case you'd be worried by the readability.
<aeth> pjb: yes, but the five different loops (only two were actually LOOPs) were harder to follow because there were a bunch of things I combined when I combined them
<pjb> sure.
<aeth> e.g. now I collect a gensym that's generated each iteration into a list of gensyms, instead of generating that list of gensyms and using it both in the loops and in the macro, which then requires MAPCARing over two lists, which is more complicated than over one
<pjb> You can write directly :for (table . accesors) :in tables-and-accessors.
<aeth> it works with :in? ok
<aeth> And, yes, I use ? here instead of -p because it's a query mini-language (as the name suggests)
<aeth> it queries a big, complicated data structure and symbol-macrolets away the implementation details to the variables you provide
<AeroNotix> prefer ? personally
<pjb> aeth: try to split it out in 5 loops. I'm sure you'll like the result.
<aeth> pjb: I had it in 5 separate loops (well two were LOOPs and two were MAPCAR and one was REDUCE) and I couldn't read it
<aeth> I could possibly spin out the boolean-set number generation into its own function because it isn't heavily tied to the rest.
<pjb> (,changed?-array (changed? ,ecs)) is probably a bug: you're not using the aprameter.
<aeth> pjb: I stored it in a slot in ECS accessed via changed?
<aeth> I probably could call it changed-bits or something
<aeth> too much changed?
<aeth> then I can rename %changed? to changed? without being too confusing
<aeth> (I made it %changed? to make it clear that it shouldn't be used directly anywhere)
<aeth> Essentially this is a dirty bit for the renderer, but I don't like calling it dirty
<aeth> Any mutation that changes the visuals of the engine must make changed? T and if you need to access the value of changed (but not set it!) you use LET-CHANGED? to get the result of `(= 1 ,%changed?)
elfmacs has joined #lisp
<pjb> aeth: whata bout: https://gitlab.com/snippets/1750355
<aeth> 404
<aeth> I think you made it private
<pjb> How do I make it public?
<aeth> it's an option when you edit it
<pjb> Try again.
<aeth> pjb: that's very similar to what I had before
<pjb> of course.
<aeth> I think the big loop is more readable if I can replace the append, with the possible exception of the boolean-set part, which I could just spin off into a function and put at the top of the loop in another :with
<aeth> s/replace the append/replace the complicated append/
<pjb> But it may (reload it I missed the bindings function) be easier to read, since the naming of the important data is clearer in the let* form, and we can abstract away parts such as the bindings function (we could do the same for array-bindings and boolean-set); those functions could be reusable, etc.
<aeth> pjb: Well, in one intermediate step I had the loop return multiple values into a multiple-value-bind. It seemed kind of pointless, *but* if I moved the loop into a separate function, it could be cleaner
<pjb> The thing is that by writing separate loops, you can extract the computing of each list in a separate function.
<pjb> And since it remains O(n), it's ok, moreso at macroexpansion time.
Fare has joined #lisp
<pjb> ok, now, magic stick! I need all my past lisppaste pastebin etc, moved into snippets.
<pjb> Actually, I've got a backup of lisppaste with almost all of them. And scanning the irc logs, I could recover almost all the other urls…
Oladon has quit [Quit: Leaving.]
<aeth> I'll probably move back the boolean-set one to a reduce in its own function, though.
<aeth> array-bindings is the non-trivial part I have to figure out how to deal with (whether in its own loop or not).
kdas_ has joined #lisp
<aeth> oh, it probably has to be in the same loop because it uses the same name gensym.
kushal has quit [Quit: ZNC 1.7.0 - https://znc.in]
makomo has quit [Ping timeout: 240 seconds]
Arcaelyx has quit [Ping timeout: 240 seconds]
slyrus1 has quit [Ping timeout: 240 seconds]
dddddd has quit [Remote host closed the connection]
trocado has joined #lisp
it3ration has joined #lisp
it3ration has quit [Ping timeout: 272 seconds]
azimut has quit [Ping timeout: 246 seconds]
azimut has joined #lisp
Arcaelyx has joined #lisp
jinkies has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
rozenglass has quit [Read error: Connection reset by peer]
rozenglass has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
aindilis has joined #lisp
Khisanth has quit [Ping timeout: 272 seconds]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
siraben has quit [Quit: ERC (IRC client for Emacs 26.1)]
pierpa has quit [Quit: Page closed]
Khisanth has joined #lisp
acolarh has quit [Ping timeout: 252 seconds]
igemnace has joined #lisp
fortitude_ has quit [Quit: Leaving]
FreeBirdLjj has joined #lisp
acolarh has joined #lisp
<beach> Good morning everyone!
jinkies has quit [Read error: Connection reset by peer]
jinkies has joined #lisp
k-hos has quit [Read error: Connection reset by peer]
Denommus has joined #lisp
drewc has quit [Ping timeout: 268 seconds]
k-hos has joined #lisp
trocado has quit [Remote host closed the connection]
jinkies has quit [Read error: Connection reset by peer]
panji has joined #lisp
it3ration has joined #lisp
jinkies has joined #lisp
it3ration has quit [Ping timeout: 240 seconds]
Roy_Fokker has quit [Read error: Connection reset by peer]
Bike has quit [Quit: Lost terminal]
jinkies has quit [Read error: Connection reset by peer]
jinkies has joined #lisp
elfmacs has quit [Ping timeout: 252 seconds]
_whitelogger has joined #lisp
<beach> Yes, (map-into v #'float v)
<beach> Or something slightly more complicated.
<beach> (map-into v (lambda (x) (float x 1s0)) v)
igemnace has quit [Read error: Connection reset by peer]
igemnace has joined #lisp
LdBeth has joined #lisp
<LdBeth> Good evening
Pixel_Outlaw has quit [Remote host closed the connection]
<beach> Hello LdBeth.
<drmeister> Plotting graphs in jupyterlab using Common Lisp...
no-defun-allowed has joined #lisp
panji has quit [Remote host closed the connection]
<no-defun-allowed> nice
bradcomp has joined #lisp
charh has joined #lisp
<SaganMan> Morning Peeps
<SaganMan> Morning beach. How are you? How is your research going?
kdas_ is now known as kushal
<beach> SaganMan: I am fine, thank you. I have been making excellent progress on bootstrapping the past few days. What about you?
<SaganMan> beach: I'm good. The business is going fine.
<beach> Great! What is your business?
<SaganMan> beach: I'm in my family business. It's real estate and construction. We take land for development and construct apartments.
<beach> Nice!
<SaganMan> beach: this is our latest project http://www.ashirvaadbuildtech.com/
<beach> Impressive.
<SaganMan> beach: It's in Bangalore which is IT hub in India.
caltelt_ has joined #lisp
<beach> I see, yes.
<no-defun-allowed> hi beach
<beach> Hey no-defun-allowed.
<SaganMan> beach: We don't usually do projects on that grand scale. That is the biggest investment in mine and my father's life. It looks impressive but it's great risk and stress.
<beach> I can imagine.
rocx has quit [Remote host closed the connection]
<no-defun-allowed> i think i could generalise the cl-vep image generator a bit
bradcomp has quit [Ping timeout: 240 seconds]
it3ration has joined #lisp
it3ration has quit [Ping timeout: 252 seconds]
vlatkoB has joined #lisp
caltelt_ has quit [Ping timeout: 252 seconds]
dented42 has joined #lisp
<phoe> Hey hi
<beach> Hello phoe.
<no-defun-allowed> well my ffmpeg interface is still shitslow at 4fps but the videos aren't broken now
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
CrazyEddy has quit [Ping timeout: 268 seconds]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dented42 has joined #lisp
elfmacs has joined #lisp
CrazyEddy has joined #lisp
zaquest has quit [Remote host closed the connection]
Fare has quit [Ping timeout: 245 seconds]
doubledup has joined #lisp
doubledup has quit [Max SendQ exceeded]
doubledup has joined #lisp
razzy has quit [Ping timeout: 240 seconds]
flazh has quit [Ping timeout: 240 seconds]
quazimodo has quit [Ping timeout: 246 seconds]
quazimodo has joined #lisp
orivej has joined #lisp
razzy has joined #lisp
it3ration has joined #lisp
it3ration has quit [Ping timeout: 246 seconds]
cage_ has joined #lisp
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
libre-man has quit [Ping timeout: 240 seconds]
asarch has quit [Ping timeout: 252 seconds]
libre-man has joined #lisp
light2yellow has joined #lisp
astalla has joined #lisp
runejuhl has joined #lisp
flazh has joined #lisp
jinkies has quit [Remote host closed the connection]
igemnace has quit [Quit: WeeChat 2.2]
SlashLife has quit [Ping timeout: 252 seconds]
SlashLife has joined #lisp
varjag has joined #lisp
lavaflow has quit [Ping timeout: 245 seconds]
steiner has quit [Read error: Connection reset by peer]
fikka has joined #lisp
moei has quit [Quit: Leaving...]
it3ration has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
stardiviner has quit [Ping timeout: 250 seconds]
it3ration has quit [Ping timeout: 240 seconds]
random-nick has joined #lisp
fikka has joined #lisp
SaganMan has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 240 seconds]
elfmacs has quit [Ping timeout: 240 seconds]
razzy has quit [Ping timeout: 246 seconds]
fikka has joined #lisp
razzy has joined #lisp
[X-Scale] has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
X-Scale has quit [Ping timeout: 252 seconds]
[X-Scale] is now known as X-Scale
azimut has quit [Ping timeout: 245 seconds]
fikka has joined #lisp
azimut has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
moei has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 252 seconds]
fikka has joined #lisp
fikka has quit [Ping timeout: 252 seconds]
steiner has joined #lisp
fikka has joined #lisp
makomo has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
fikka has joined #lisp
elfmacs has joined #lisp
fikka has quit [Ping timeout: 252 seconds]
_whitelogger has joined #lisp
dddddd has joined #lisp
steiner has quit [Remote host closed the connection]
Lycurgus has quit [Ping timeout: 272 seconds]
lavaflow has quit [Ping timeout: 250 seconds]
steiner has joined #lisp
<makomo> pjb: i managed to find one occurence of the (4) (3) ordering, https://www.hexstreamsoft.com/libraries/place-utils/#funcallf-applyf
<makomo> granted, funcallf is just _f in disguise, but the evaluation order has been explictily documented (and therefore thought through)
fikka has joined #lisp
elfmacs has quit [Quit: WeeChat 2.2]
veinof is now known as veinofsortain
fikka has quit [Ping timeout: 272 seconds]
quazimodo has quit [Ping timeout: 272 seconds]
quazimodo has joined #lisp
steiner has quit [Remote host closed the connection]
steiner has joined #lisp
azimut has quit [Ping timeout: 272 seconds]
fikka has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
it3ration has joined #lisp
lavaflow has joined #lisp
fikka has quit [Ping timeout: 252 seconds]
it3ration has quit [Ping timeout: 252 seconds]
Bike has joined #lisp
azimut has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
quazimodo has quit [Ping timeout: 252 seconds]
quazimodo has joined #lisp
random-nick has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
fikka has quit [Ping timeout: 252 seconds]
<adlai> "risk and stress" ... yep, that sounds like components of the construction Hamiltonian. story checks out!
Lycurgus has joined #lisp
SpikeMaster has joined #lisp
<SpikeMaster> hello lisp.
<phoe> woooo boy
<phoe> ftp://ftp.ai.mit.edu/people/naha/WordNet/WordNet.html
<phoe> I wonder if this runs on contemporary Lisps
azimut has quit [Ping timeout: 240 seconds]
<phoe> #+Genera (scl:defsystem WordNet ...)
<phoe> aaah~
<phoe> This code was done in 1995
fikka has joined #lisp
azimut has joined #lisp
fikka has quit [Ping timeout: 272 seconds]
<phoe> ...and it does contain curse words
<phoe> I already like it
<beach> Hello SpikeMaster.
light2yellow has quit [Quit: brb]
random-nick has joined #lisp
<phoe> This is crazy.
<phoe> I'm running code that's fifteen years old and the only thing that was really required is fixing it to use ASDF.
azimut has quit [Ping timeout: 252 seconds]
fikka has joined #lisp
<beach> Nice.
<phoe> I have something for you, beach - this thing has a CLIM browser. (:
SenasOzys has quit [Ping timeout: 246 seconds]
smokeink has joined #lisp
<phoe> _death: oh goodness
<beach> phoe: I saw that.
azimut has joined #lisp
fikka has quit [Ping timeout: 246 seconds]
astalla has quit [Ping timeout: 252 seconds]
Fare has joined #lisp
SenasOzys has joined #lisp
azimut has quit [Ping timeout: 245 seconds]
fikka has joined #lisp
azimut has joined #lisp
SpikeMaster has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
fikka has quit [Ping timeout: 252 seconds]
SpikeMaster has joined #lisp
SpikeMaster has quit [Remote host closed the connection]
SpikeMaster has joined #lisp
SpikeMaster has left #lisp [#lisp]
azimut has quit [Ping timeout: 245 seconds]
<smokeink> compiling nodes question http://pastecode.ru/8ef7b9/
shka_ has joined #lisp
<shka_> good afternoon
<smokeink> good afternoon
fikka has joined #lisp
<Bike> smokeink: no. as a parameter to f, A is a lexical variable.
<phoe> pjb: yes
<Bike> i'm not really sure what you're trying to do here, though.
<pjb> smokeink: add a (declare (special a) in the lambda.
<pjb> Sorry, I mean (declare (special myvar) in the let.
<pjb> err, not yet.
fikka has quit [Ping timeout: 240 seconds]
<pjb> smokeink: your code is full of bug, that's why I cannot say anything consistent about it.
<pjb> (quote apple) is not a function, so compile-node will return nil anyways.
<pjb> and there's no link between f and compile-node.
<phoe> (defun foo (...) (declare (values ...)))
<phoe> huh
<phoe> That's a strange declaration
<smokeink> pjb: ignore f, I first typed that f function to specifically ask whether myvar can access that a in some way or not
<Bike> that's in what, clisp or something? to indicate return value types
<Bike> it's not standard
<smokeink> I have two types of nodes , I only presented one type of node in that "example"
<smokeink> terminal nodes have symbols in them
<smokeink> nonterminal nodes have functions in them (instead of that 'apple )
<phoe> Bike: it's code from 1995
<pjb> smokeink: it can. Just declare a as special.
<Bike> still nonstandard
<phoe> yep
<pjb> smokeink: why do you use lists with the quote symbol as first element?
<pjb> This is useless and confusing.
<smokeink> I just wrote a snippet, I didn't paste my actual code because the actual code has other unnecessary details
azimut has joined #lisp
<smokeink> pjb: that was a typo , that node is just `(root apple) , nothing else
<pjb> Well, they you get those answers above, instead of the actual answer.
<pjb> I'll try to add typoes too.
fikka has joined #lisp
<smokeink> I should have typed it as `(root apple) or as (list 'root 'apple)
<phoe> (get-synonyms "horse" :noun) ;=> (("horse" 0) ("horse_cavalry" 1) ("cavalry" 1) ("horse" 0) ("Equus_caballus" 0) ("horse" 3) ("gymnastic_horse" 0) ("sawhorse" 0) ("horse" 1) ("sawbuck" 0) ("buck" 0))
<phoe> woah, this thing workd!
<phoe> works!*
<pjb> smokeink: you test for (functionp myvar) and then in the case you test for symbols. Therefore the case will always return nil, if myvar is bound to a function, and the IF will return nil if not.
<pjb> smokeink: a compiler can detect that at compilation time, so it can generate (lambda (a b) (declare (ignore a b)) nil) instead.
<smokeink> ahh , I had a funcall there, forgot to type it
fikka has quit [Ping timeout: 245 seconds]
<smokeink> http://pastecode.ru/9430ad/ fixed the two typos
<pjb> smokeink: ok, better. Now what is the question?
<pjb> This compile-node function seems to be doing something.
<smokeink> no question for now, I'll first try to see if declaring vars special will work well or not
steiner has quit [Read error: Connection reset by peer]
<smokeink> thanks for the quick response
steiner has joined #lisp
<pjb> smokeink: ^
flazh has quit [Ping timeout: 244 seconds]
fikka has joined #lisp
<pjb> smokeink: reload https://gitlab.com/snippets/1750435 I've added a few lines.
<smokeink> cool, thank you
steiner has quit [Read error: Connection reset by peer]
steiner has joined #lisp
flazh has joined #lisp
Jesin has quit [Quit: Leaving]
<phoe> Sigh
<phoe> How is that code licensed though?
<phoe> I assume it has been published back in the day when hardly anyone thought of licenses
fikka has quit [Ping timeout: 272 seconds]
<phoe> But it would be bold for me to assume any license at all if the author put none on it.
<pjb> Just locate the author and ask them.
<phoe> pjb: I did. All I have is the email address @ai.mit.edu which might or might not work after all these years.
<phoe> And googling for the person reveals last traces of activity in 2001.
<phoe> Wait. No. This code is 23 years old.
jinkies has joined #lisp
<pjb> (- 2018 2001) #| --> 17 |# it's consistent.
<oni-on-ion> wordnet? o_o
<phoe> Well. Last traces of activity are from 17 years ago.
<phoe> And the domain .ai.mit.edu is no longer active - it redirects elsewhere.
it3ration has joined #lisp
fikka has joined #lisp
<phoe> pjb: there's no mailserver at ai.mit.edu. I have no direct means of contacting the author.
steiner has quit [Remote host closed the connection]
azimut has quit [Ping timeout: 240 seconds]
it3ration has quit [Ping timeout: 252 seconds]
fikka has quit [Ping timeout: 252 seconds]
<pjb> phoe: the "copyright" seems to be: 1995, Mark Nahabedian
azimut has joined #lisp
<phoe> pjb: yes, exactly, I've googled the person.
<pjb> phoe: since it comes from the MIT, it might be under the MIT license. But you'd need confirmation.
Denommus has quit [Remote host closed the connection]
<pjb> Have you tried Mark Nahabedian <Naha@AI.MIT. EDU>?
<pjb> s/. //
<phoe> pjb: there's no mailserver at ai.mit.edu.
<pjb> phoe: it might be at Google/ITA: https://imagebin.ca/v/4EK069bhAQj2
<pjb> s/it/he/
<phoe> Ha!
<phoe> They seemingly do Golang nowadays.
<phoe> That message is from just a few days ago.
<phoe> pjb: thanks!
<pjb> naha@mit.edu :-)
<phoe> Yessss
<phoe> Oh boy, not only I'm doing programming, I'm also doing archaeology
nika has joined #lisp
<pjb> lisp is fun.
<phoe> Definitely is
flazh has quit [Ping timeout: 240 seconds]
Lycurgus has quit [Quit: Exeunt]
<oni-on-ion> aeth: check out recent release notes if you havnt already, http://www.sbcl.org/all-news.html , like 1.4.10 adding or subtracting 1 from a fixnum does not cons. =)
fikka has joined #lisp
<smokeink> optimization question http://pastecode.ru/3b8a06/
ski has quit [Quit: leaving]
<pjb> smokeink: define "better".
<pjb> smokeink: have a look at the sources of the sbcl or sicl compilers?
<pjb> smokeink: I wouldn't worry about that for now. Just build your system, and make it work. If there remain time then, you will be able to have more philosophical questions…
<smokeink> Since my code is a bit complicated than this snippet, it might result into many ifs and cases , and that's not very nice. Just wondering if you guys can spot a different solution
<phoe> smokeink: you're basically doing a big typecase, aren't you?
FreeBirdLjj has quit [Remote host closed the connection]
<pjb> smokeink: the alternative to code, is data.
trocado has joined #lisp
<smokeink> perhaps a big typecase will do
<phoe> if yes, you might want to instead go CLOS and use a generic function; this will move the dispatch from a massive CASE into individual methods
<phoe> you could define a single GF and dispatch based on classes
<phoe> (defclass apple ...) (defclass banana ...) (defgeneric frobnicate (fruit)) (defmethod frobnicate ((apple apple)) ...) (defmethod frobnicate ((banana banana)) ...)
<smokeink> okay
<pjb> You could have a table of predicate and functions to generate the code, so you'd just write (funcall (optimization-generate (find-if (lambda (predicate) (funcall predicate myvar)) table :key (function optimization-predicate))))
<pjb> or use CLOS as phoe indicates.
<phoe> CLOS already has the kind of dispatch you seem to want
fikka has quit [Ping timeout: 246 seconds]
<pjb> even (typecase myvar (function …) ((eql apple) …) ((eql banana) …))
<jackdaniel> the question is: what is easier to optimize: a few symbols + typecase or a few classes + gf dispatch
<jackdaniel> by a compiler
<jackdaniel> as of constant values, you may consider compiler macros for functions
<phoe> CLOS might be much cleaner code-wise if you have multiple typecases
<pjb> See, you need to define "better". And this depends a lot on your program.
<phoe> as for performance, a typecase might be faster if all of your types are classes and therefore type comparison is going to be pointer equality
<jackdaniel> clos might be but doesn't have to be cleaner. it is easy to do a mixin spaghetti with unobvious method invocation structure
<phoe> jackdaniel: yep, I was thinking about the simple case
fikka has joined #lisp
SaganMan has joined #lisp
francogrex has joined #lisp
<oni-on-ion> also structs work with gf
<pjb> smokeink: for example, a given optimization may need to do things or generate expressions at several places, to prepare the optimization or complete it. You may need temp variables, initializations, cleanup, in addition to the code generated at the place of interest. Then you will need several functions (or methods) for a given optimization. This would exclude the typecase solution. (CLOS methods or a table managed by yourself w
<pjb> do)>
<pjb> smokeink: but what is "better" depends on whether you have such needs for your optimizations.
<pjb> oni-on-ion: all lisp objects work with gf.
fikka has quit [Ping timeout: 245 seconds]
<oni-on-ion> "what is easier to optimize" seems a clear question to me. CLOS is slower for GF because classes can change in runtime. as opposed to say julia where all code paths are decided before runtime
<pjb> oni-on-ion: CLOS can reach the 2 JSR on GF calls. Just like Objective-C. Can julia dispatch in less than 2 JSR?
<oni-on-ion> oh its faster than objective-c definately
<phoe> pjb: what's JSR?
aindilis has quit [Ping timeout: 246 seconds]
<pjb> jump to sub routine.
<pjb> the assembler equivalent of funcall.
fikka has joined #lisp
rippa has joined #lisp
orivej has quit [Ping timeout: 245 seconds]
<oni-on-ion> i think often julia does not do any jumps, when the code is called "type stable" the compiler can already know the code path and lay it out before eval (all code is compiled with llvm) with or without declaring inline
<oni-on-ion> this feature of clos is exactly why i need lisp right now though (to update code in a live server)
flazh has joined #lisp
fikka has quit [Ping timeout: 252 seconds]
FreeBirdLjj has joined #lisp
fikka has joined #lisp
Shinmera has quit [Remote host closed the connection]
nowolfer has quit [Ping timeout: 240 seconds]
<smokeink> tried to make myvar special but it doesn't seem to work: http://pastecode.ru/c4d5d/
Shinmera has joined #lisp
<smokeink> if I manage to capture a's value via myvar then I can simplify my code to a simple cond
zooey has quit [Ping timeout: 250 seconds]
isoraqathedh has quit [Quit: No Ping reply in 180 seconds.]
nowolfer has joined #lisp
<Bike> because it's special in the let, but not as a function binding
fikka has quit [Ping timeout: 240 seconds]
<Bike> (defun f (a) (declare (special a)) (let ((myvar 'a)) (symbol-value myvar)))
<Bike> i'm not sure this is a good idea, though
<smokeink> worked. Yes it looks a bit dangerous
<sabrac> jdz: Looking at your postmodern changes now.
<pjb> smokeink: first, you should read: https://groups.google.com/forum/#!msg/comp.lang.lisp/4VyopdWcFI4/1sDQU-3H8VgJ
zooey has joined #lisp
isoraqathedh has joined #lisp
<pjb> smokeink: and https://groups.google.com/forum/#!msg/comp.lang.lisp/4VyopdWcFI4/1sDQU-3H8VgJ
<francogrex> comp.lang.lisp is still alive and kicking?
Colleen has quit [Ping timeout: 272 seconds]
<phoe> francogrex: mostly a spamhouse and trollfest
Colleen has joined #lisp
<Bike> is that guy, wz or whatever, still doing it
<pjb> a "guy"? I expect the bot eventually to start replying to his own messages!
light2yellow has joined #lisp
<smokeink> haha
<smokeink> pjb: that link is really useful
<francogrex> but then aside from this chat here, what is the goto forum to post cl related messages? don't tell me it's stackoverflow now!
<pjb> nope. cll.
<pjb> I only answer on irc and on cll.
<francogrex> ok
russellw has quit []
<oni-on-ion> reddit ?
smokeink has quit [Remote host closed the connection]
fikka has joined #lisp
francogrex has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
Roy_Fokker has joined #lisp
azimut has quit [Ping timeout: 246 seconds]
francogrex has joined #lisp
<francogrex> I wonder how come almost all implementations still fail a good chunck of the ansi-tests? does that mean those tests are bollocks?
fikka has joined #lisp
shenghi has joined #lisp
asarch has joined #lisp
<pjb> francogrex: 80-20
<francogrex> what's that?
fikka has quit [Ping timeout: 252 seconds]
<francogrex> 20 percent of the code has 80 percent of the errors?
<francogrex> still doesn't explain why and why it's not fixable
fikka has joined #lisp
steiner has joined #lisp
fikka has quit [Ping timeout: 244 seconds]
<loke> pjb & Bike: Oddly enough, wj doesn't seem to have posted his usual garbage for over a week?
<loke> Perhaps he's charging up for another onslaught?
<Bike> a /week/? last time i looked at that place was like two years ago
<Bike> god damn
<loke> To most recent message from him that I can see was from 14'th July
<loke> so it's a month and a half
<loke> I don't think he's been off for that long... ever?
<loke> did he fianlly get bored?
<shka_> loke: no
<shka_> spam is still on
<loke> shka_: I'm checkin gon Google Reader, which to my knowledge doesn't filter spam at all.
<loke> i mean groups
<shka_> but #lisp is for just registered people now
<shka_> loke: i got spam at #clnoobs last week
steiner has quit [Ping timeout: 244 seconds]
FreeBirdLjj has joined #lisp
light2yellow has quit [Quit: brb]
<jinkies> pjb: what is cll?
fikka has joined #lisp
<beach> comp.lang.lisp
<beach> A Usenet news group.
fikka has quit [Ping timeout: 245 seconds]
it3ration has joined #lisp
fikka has joined #lisp
fikka has quit [Read error: Connection reset by peer]
it3ration has quit [Ping timeout: 240 seconds]
steiner has joined #lisp
makomo has quit [Quit: WeeChat 2.2]
quazimodo has quit [Ping timeout: 246 seconds]
quazimodo has joined #lisp
kajo has quit [Ping timeout: 240 seconds]
<phoe> francogrex: #lisp on IRC, Lisp Discord server and /r/common_lisp first and foremost
<phoe> also a little bit of stackoverflow
<phoe> and a little bit of cll (if you're willing to moderate it yourself).
fikka has joined #lisp
azimut has joined #lisp
<francogrex> in sbcl when you disassemble you get the mem address of the function in the output. in ccl it's not output but does anyone recall how to get the memory address otherwise?
fikka has quit [Ping timeout: 240 seconds]
azimut has quit [Ping timeout: 245 seconds]
steiner has quit [Remote host closed the connection]
shka_ has quit [Ping timeout: 252 seconds]
<francogrex> it's ok. in most cases i suppose (inspect 'function-name) can do just that
<phoe> francogrex: why do you need the address at all?
wigust has joined #lisp
<francogrex> examing the assembly instructions of a function by attaching to gdb (yeah)
<francogrex> but it's ok
fikka has joined #lisp
francogrex has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
steiner has joined #lisp
<drmeister> What's the best infix math library for Common Lisp?
<phoe> drmeister: what operators do you want to have in there?
<phoe> +-:/% and what else?
<drmeister> I want infix arithmetic in Common Lisp without tears.
<phoe> drmeister: yes, but what exactly do you mean by "infix arithmetic"?
<phoe> Which operators?
<phoe> ruricolist's library is generic and should work decently
<phoe> oh, it does have a list of operators it recognizes in the README
<drmeister> All the most popular ones. I'm building a web based scientific programming environment and I'd like to be able to transcribe equations without converting them into s-expressions.
light2yellow has joined #lisp
<drmeister> Optionally - mind you. I'm not taking anything away.
fikka has quit [Ping timeout: 240 seconds]
<phoe> You could use that library, I think
<drmeister> I recall looking into this a year ago and I thought I was working with a different library.
<phoe> if someone inputs "2 + 2" you could (eval (cons $ (read-from-string (concatenate 'string "(" "2 + 2" ")"))))
<phoe> uh I mean
<phoe> (eval (cons '$ (read-from-string (concatenate 'string "(" input ")"))))
<phoe> for any INPUT that the user inserts
<phoe> I wonder if $ errors on unknown operators; if yes, then it would solve a part of input sanitization problem
shka_ has joined #lisp
fikka has joined #lisp
<pjb> as soon as they make a gnus plugin for discod and stackoverflow..
<drmeister> Ok - thank you - I'll work from those.
<_death> I thought lobste.rs might be interesting because it exposes a mailing list format, which can then be fed to gmane and read using gnus.. but I've no lobste.rs account
fikka has quit [Ping timeout: 240 seconds]
<drmeister> Now that I've got things like this working...
<drmeister> My mind starts to wander to infix arithmetic
<_death> but now I remember that gmane is part dead.. at least gwene is OK.. and then there's that gnusdumps thing I wrote back then
<Bike> btw, pi is a constant, so you can just do (* 2 pi)
<drmeister> Is it? Neat - Common Lisp has everything.
quazimodo has quit [Ping timeout: 246 seconds]
<pjb> (defconstant 2pi (* 2 pi))
<pjb> (defconstant pi/2 (/ pi 2)) ; etc.
quazimodo has joined #lisp
shrdlu68 has joined #lisp
<drmeister> Gotcha - thanks!
light2yellow has quit [Quit: brb]
jmercouris has joined #lisp
rumbler31 has joined #lisp
rumbler31 has quit [Remote host closed the connection]
azimut has joined #lisp
<shrdlu68> Good evening, fellow Eukaryota. In http://www.sbcl.org/manual/#Hash-Table-Extensions, in the explanation for :weakness, what does "live" mean?
<Bike> "accessible" is synonymous
<phoe> shrdlu68: something else that's not a weak pointer must have a reference to it.
<phoe> "otherwise accessible" is kind of that term
<phoe> if this value is pointed to only by weak pointers, then it's not live and may be collected at any time.
<drmeister> A live object is in memory and has not been garbage collected.
<shrdlu68> I see, thanks!
<phoe> drmeister: that word is used in a slightly different context here
<beach> drmeister: No, that's not how it is typically used.
<drmeister> Which word?
<phoe> we're thinking weak hash tables, in which values may be garbage collected
<phoe> "live"
<beach> drmeister: A live object is one that is reachable from the roots.
<drmeister> This is why I don't tend to answer questions. (sigh)
<beach> drmeister: ... whether it has been collected or not.
<drmeister> Ok.
<drmeister> At least I learned something.
* drmeister returns to muddling through with his own flawed perspective of the world.
fikka has joined #lisp
kajo has joined #lisp
<pjb> Weak references can reference not only live objects, but also zombies.
<drmeister> Sorry - that all sounded a bit defensive - I appreciate the feedback very much.
<pjb> weak references are not life-insuffling references.
<phoe> drmeister: I understand how it is - no problem
<pjb> weak-references are live-or-dead warrants :-)
azimut has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 245 seconds]
steiner has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
fikka has joined #lisp
<drmeister> On a different topic: I swear, every time we (:use ...) anything other than :common-lisp in a defpackage - I've committed to spending time in the future ripping it out and dealing with explicitly adding the package name in front of symbols.
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
<_death> yes, only :use :cl and packages controlled by yourself.. otherwise, :import-from
FreeBirdLjj has quit [Remote host closed the connection]
<shka_> i simply have dedicated package in each project just to import and reexport ;-)
fikka has quit [Ping timeout: 252 seconds]
<pjb> or let's use package versions in the package names…
johs has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
lemonpepper24 has joined #lisp
<phoe> oh goodness
<phoe> this wordnet code is so old it uses symbol properties
<phoe> clhs get
<pjb> I love it.
fikka has joined #lisp
<pjb> phoe: notice that since CL has packages, it just does not matter at all!
<pjb> And while you keep optimizing your access time into O(1) slow gethash accesses, ccl readtable uses an a-list for reader macros…
pierpal has quit [Client Quit]
<phoe> pjb: I know it doesn't matter, it's just that I had to `clhs get` to remember what that part of CL does
pierpal has joined #lisp
sz0 has quit [Quit: Connection closed for inactivity]
rozenglass has quit [Read error: Connection reset by peer]
azimut has joined #lisp
fikka has quit [Ping timeout: 246 seconds]
light2yellow has joined #lisp
astalla has joined #lisp
fikka has joined #lisp
kuwze has joined #lisp
nowolfer has quit [Quit: leaving]
fikka has quit [Ping timeout: 245 seconds]
Denommus has joined #lisp
light2yellow has quit [Quit: light2yellow]
fikka has joined #lisp
nika has quit [Quit: Leaving...]
fikka has quit [Ping timeout: 244 seconds]
it3ration has joined #lisp
fikka has joined #lisp
it3ration has quit [Ping timeout: 246 seconds]
fikka has quit [Ping timeout: 246 seconds]
fikka has joined #lisp
Oladon has joined #lisp
fikka has quit [Ping timeout: 246 seconds]
azimut has quit [Read error: No route to host]
cage_ has quit [Quit: Leaving]
azimut has joined #lisp
fikka has joined #lisp
<aeth> oni-on-ion: but there are lots of things that you would expect from an optimizing compiler in 2018 that SBCL does not yet (afaik) do, like when looping over short arrays of known length (e.g. 3), it doesn't loop unroll afaik even with (speed 3) (space 0).
lumm has joined #lisp
<oni-on-ion> whoa
<oni-on-ion> ive heard that sbcl was really advanced
<oni-on-ion> ive been impressed so far with julia's compiler , helped with its type system for knowing dispatch paths at compile time
fikka has quit [Ping timeout: 244 seconds]
<aeth> oni-on-ion: SBCL was really advanced, it's just that it has to keep up with the competition
<oni-on-ion> why does it have to keep up?
<oni-on-ion> ghc is advanced, ocaml is advanced, and gcc is advanced, erlang is advanced... those are single implementations though
<oni-on-ion> julia as well. doesnt sbcl have limits of what it can do, considering how many kinds of lisp there could be ?
<Bike> fundamental limits on compilers are due to basic CS theory
<Bike> i don't know what "how many kinds of lisp there could be" is supposed to mean
<aeth> oni-on-ion: If SBCL is 3x slower than C/C++ on some benchmarks then that means there's still room for improvements.
<oni-on-ion> Bike: variations on lisp forms. for eg more strict syntax compilers have certain assumptions they can make
<Bike> syntax is not relevant to most of the interesting parts of a compiler
<oni-on-ion> say, being able to do (let ((..)) (defun ...)) and other acrobatics, i am thinking the compiler can find less opportunities for optimisation
<Bike> closures make things hard, yes. that's semantics, not syntax.
<oni-on-ion> whereas say haskell and julia compilers can make assumptions based on types
<oni-on-ion> ah hmm
<aeth> There might be a limit to CL because of its GC because different advanced GCs probably have different tradeoffs in what they can do.
<Bike> types are not directly related
<oni-on-ion> i thought sbcl was in the same "order of magnitide" as c, aeth
<oni-on-ion> Bike: types being i guess semantics. which are helpful hints if not guarantees for a compiler to make
<Bike> what a "type" is means different things in different languages.
<aeth> oni-on-ion: Personally I think well-written SBCL is where C would be if C and C++ compilers didn't turn into incredibly ridiculous optimizations in recent years. That actually would be easy to test, though. Write the same thing in SBCL and in C with optimizations off (or perhaps a smaller, more minimal C compiler)
<oni-on-ion> yes. yeah, not sure why that needs clarification
<aeth> s/turn into/turn to/
<oni-on-ion> Bike: i guess an analogy: if i knew my way to the store, i can take shortcuts easily. if i dont know where i am going, this is a different story
<oni-on-ion> aeth: hmm.
<aeth> oni-on-ion: It's a bit of a lie to say that SBCL is as fast as Foo, though, because if you look at the SBCL that is benchmarked well, it has type declarations all over the place and is essentially statically typed in addition to dynamically typed.
<aeth> It's probably not the CL style most people are writing.
<oni-on-ion> aeth: yeah.. however i like the idea that one can write/prototype quickly , then amend and freeze in the types afterward
<aeth> oni-on-ion: That would be great. I'd say the main weakness is that the "frozen" types are generally just lexical variables from things like a LET or a DEFUN, and not in data structures, though. The main exceptions are certain specialized array types and (possibly) slots with :type in defstruct since (iirc) slot accessors can be inlined because redefining a struct is undefined behavior.
<oni-on-ion> ahh, true hmm.
<aeth> Being able to notice a type that you're using for all of the contents (or keys!) for a hash table and make them specialized like an array would be nice.
fikka has joined #lisp
<p_l> aeth: ehhhh, it shows that something can be fast, and partially shows the amount of work needed
azimut has quit [Ping timeout: 246 seconds]
azimut has joined #lisp
fikka has quit [Ping timeout: 244 seconds]
<Bike> anyone know where the cffi issues tracker is? i don't see it on github
<pjb> It's rather silly. Nowadays, when I want fast, I go cuda.
<pjb> So a CL implementation would better integrate better with cuda, than optimize lisp code…
Jesin has joined #lisp
<p_l> Depends on the goal, but one could do some "little language" that compiled to PTX assembly, yes
<aeth> p_l: If you're replying to the 3x slower means there's room for improvements, then yes, it is a lot of work, but there's afaik diminishing returns each time so even if C/C++ compilers (lumped together because they're usually the same compiler afaik) have the same rate of effort spent on them each year, they shouldn't really pull away from CL in performance, and CL might actually get closer over time.
<p_l> Just like GCC does in recent versions
<p_l> (Also, CUDA simply does not work in performant way once your work stops being nicely SIMD-able)
<aeth> pjb: There should be more Lispy DSLs that target SPIR-V for Vulkan/OpenCL. (Forget CUDA, that's just nvidia. AMD and Intel need to step up and help promote the open standards more so nvidia is forced to follow them.)
<pjb> And let's remember that this race to speed in C and its underlying processors, is what leads to the Meltdown bug et al.
pierpal has quit [Ping timeout: 250 seconds]
<Bike> Thank you
<pjb> Getting correct results, and getting them safely, should be the only concern that should matter.
<PuercoPop> At least that is where their website points to
azimut has quit [Ping timeout: 245 seconds]
<aeth> pjb: I'd say Meltdown/Spectre makes optimizing compilers like SBCL *more* important because the "free" hardware speedups can't be relied on if the price is security.
<pjb> In a way…
<Bike> yeah i'll just buy a machine with no branch predictor
<pjb> Good luck!
<Bike> this tracker has messages as of this summer, guess that's good enough
<Bike> what i'm wondering about is, foreign-alloc has a compiler macro that works if the type is constant and the count is constant or not provided and nothing else is provided
<Bike> hypothetically, if both are constant and :initial-contents is provided, it could still skip a runtime foreign-type-size and fill up the thing in a loop (maybe with a memcpy kind of function)
<Bike> i thought i remembered someone complaining about this before, but it's not on the tracker that i can see
azimut has joined #lisp
<p_l> pjb: Meltdown had, IMO, more in common with Intel internal management practices than with optimising for C
<pjb> It's the speed to race.
<aeth> I think the 2020s is the decade when we have to rely on software to get the continuous performance improvements that we all expect in computing. I wouldn't be surprised if single-threaded hardware gets only 3x or 4x faster in 2030 vs. 2020.
<pjb> The race to speed I mean.
<pjb> If they weren't racing for speed, but for safetly, they'd implement a lisp machine processor.
<pjb> Capabilities in the hardware.
SenasOzys has quit [Ping timeout: 272 seconds]
<p_l> pjb: it got lost in the deluge of claims about C being responsible, but it was cost-cutting at Intel that led (at least partially) to current state
fikka has joined #lisp
<p_l> I'd argue that part of why CL can get significant optimisation gains (and Java already does) is that it isn't hobbled by C's "emulate PDP-11" model which is only made performant by putting a shitton of undefined behaviour
<aeth> p_l: Can you blame them for cost cutting if each process node is exponentially more expensive? 7 nm will only have a handful of companies. I wonder if by 5 nm we'll have one or two.
<stacksmith> And general problem of corporate goals vs doing things right...
<p_l> undefined behaviour whose "typical" behaviours are actually depended on by people
Xof has joined #lisp
makomo has joined #lisp
<p_l> aeth: the cost-cutting happened when they were racing to reverse the NetBurst issue
jinkies has quit [Ping timeout: 245 seconds]
<p_l> and from time to time there were voices about letting the cpus return erroneous values for speed
<p_l> aeth: there's even a lisp story in all of that, though I do not know if AMD still uses ACL2
<aeth> p_l: On the other hand, CL does have a lot of mutability, including mutable dynamic global variables! So it has its own performance challenges.
shrdlu68 has left #lisp ["WeeChat 2.0.1"]
<aeth> (in the multicore world, I mean)
<aeth> I think the usual solution is that you can't actually rely on *foo* between threads
jmercouris has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 272 seconds]
SenasOzys has joined #lisp
<p_l> aeth: but it doesn't really stop you if you work on CSP-style programs
<p_l> which have significant benefits in NUMA world
<p_l> (especially when you deal with things like the new 4-die threadrippers, which have significant differences between NUMA zones)
<aeth> CSP?
<p_l> some of the issues on them most people haven't seen since Marvel platform Alphas
<p_l> aeth: Communicating Sequential Processes
<aeth> ah, okay. There's quite a name conflict with that acronym. https://en.wikipedia.org/wiki/CSP#Computing
vlatkoB has quit [Remote host closed the connection]
azimut has quit [Ping timeout: 272 seconds]
existential1 has joined #lisp
azimut has joined #lisp
H4ns has joined #lisp
fikka has joined #lisp
doubledup has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 245 seconds]
orivej has joined #lisp
Timzi has joined #lisp
random-nick has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
<Timzi> what does the #| |# notation mean in CL? Seems like it runs shell code, but I'm having issues searching for docs
<oni-on-ion> multiline comment
<p_l> Timzi: block comment, like /* */ in C
<aeth> It's uncommon because usually people use their tools to comment out multiple lines, e.g. M-x comment-region in emacs. And that uses the more common ;; line comment.
<Timzi> so when it has bash commands inside that's just the shell reading through and executing what it finds?
<Timzi> here's the snippet I'm looking at
fikka has quit [Ping timeout: 272 seconds]
<Timzi> @aeth that's probably why I haven't seen it I agree
<aeth> that's someone being clever and having a file that's bilingual
<aeth> #| is seen as a line comment to bash and a block comment to CL, so bash skips that line and CL skips until |#
<Timzi> ohh okay that's quirky but I like the result
<Timzi> thanks people!
<pjb> p_l: nope. They're like (* *) in pascal.
<pjb> p_l: everything's defective in C, even comments!
azimut has quit [Ping timeout: 240 seconds]
azimut has joined #lisp
<pjb> Timzi: have a look at: https://github.com/informatimago/happy
fikka has joined #lisp
regreg has quit [Read error: Connection reset by peer]
azimut has quit [Ping timeout: 240 seconds]
<Timzi> pjb: very interesting, a four language program exploiting just the grammars
<Timzi> the lisp one is neat too, might be worth switching to clisp just for the command line launcher lol
it3ration has joined #lisp
fikka has quit [Ping timeout: 246 seconds]
random-nick has joined #lisp
light2yellow has joined #lisp
it3ration has quit [Ping timeout: 272 seconds]
makomo has quit [Ping timeout: 246 seconds]
fikka has joined #lisp
fikka has quit [Ping timeout: 272 seconds]
orivej has quit [Ping timeout: 240 seconds]
light2yellow has quit [Quit: light2yellow]
fikka has joined #lisp
makomo has joined #lisp
shka_ has quit [Ping timeout: 252 seconds]
fikka has quit [Ping timeout: 250 seconds]
pierpal has joined #lisp
fikka has joined #lisp
existential1 has quit [Quit: Leaving.]
azimut has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
jmercouris has joined #lisp
<jmercouris> let's say I have a list of 12 elements, how can I iterate through it 4 elements at a time?
<jmercouris> ideally using loop macro, and not iterate
<oni-on-ion> loop by
<oni-on-ion> i dont have a mouse so i cannot search more detail, but there is a :by
<jmercouris> I could use subseq of course..
<phoe> (loop for (a b c d) on list by #'cddddr ...)
<jmercouris> oni-on-ion: doesn't :by just change the interval?
fikka has joined #lisp
azimut has quit [Read error: No route to host]
<oni-on-ion> oops, one sec
<Bike> for list iteration, it changes how you iterate.
azimut has joined #lisp
<oni-on-ion> just use loop in a macro for the 4 times. =P
<jmercouris> lol
<oni-on-ion> (loop ... `(loop ..))
<jmercouris> also I don't like the cdddr solution
<jmercouris> though that does work
light2yellow has joined #lisp
<Bike> what about it do you not like
<jmercouris> it just seems convoluted, I would look at the code later and wonder, why is it jumping by 4 cons cells??
<jmercouris> like, it isn't clear what the purpose is
<Bike> because you want four elements at a time?
<jmercouris> and I would still within the body need to traverse those four elements
<trittweiler> jmercouris, I usually use (let ((the-list ...)) (loop while the-list for a = (pop the-list) for b = (pop the list) ... ) you can play with the exit condition depending how you want to deal with a list of length that is not a multiple of 4
<Bike> er, what?
<jmercouris> maybe I'm best off making a few cons' and making a list of lists
<Bike> no, no, what are you even talking about
<pjb> jmercouris: (loop for (a b c d) on list by (lambda (list) (nthcdr 4 list)))
light2yellow has quit [Client Quit]
<Bike> (loop for (a b c d) on '(1 2 3 4 3 3 3 3 1 2 1 2) by #'cddddr collect (+ a b c d)) => (10 12 6), is that not what you want?
<jmercouris> that is not what I want
<Bike> Oh. What do you want?
<pjb> jmercouris: for complex walks, you might want to (coerce list 'vector)…
<jmercouris> Instead of (a b c d), I'd like a symbol pointing to a list of length 4
<pjb> for list-of-four instead of for (a b c d)
<jmercouris> of course I could within the body do (list a c d)
<Bike> oh, you'll have to allocate new sublists then.
fikka has quit [Ping timeout: 252 seconds]
<Bike> so maybe list of lists would be better.
<pjb> jmercouris: the key word here is :ON.
<jmercouris> :ON?
aindilis has joined #lisp
<pjb> (loop for 4-elems ON list by #'cddddr ...)
<jmercouris> ah
<pjb> Oh, it's true that it gives all the rest.
<pjb> so you'd have to (subseq 4-elems 0 4)…
<jmercouris> so we are back to subseq :P
<jmercouris> I'll just make the cons then, no big deal
<jmercouris> I'll cache the sublists for efficiency
<pjb> (loop for 4elems in (com.informatimago.common-lisp.cesarum.sequence:group-by (iota 22) 4) collect 4elems) #| --> ((0 1 2 3) (4 5 6 7) (8 9 10 11) (12 13 14 15) (16 17 18 19) (20 21)) |#
<pjb> jmercouris: do you receive PMs?
<p_l> aeth: btw, regarding drop in QA at intel: https://danluu.com/cpu-bugs/
caltelt_ has joined #lisp
<jmercouris> pjb: Ah sorry, my modeline hadn't updated
<_death> pjb: what's the point of the loop here
slyrus1 has joined #lisp
<pjb> _death: probably you will do something else than collect; Here collect is to show what's bound to 4elems.
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
caltelt_ has quit [Ping timeout: 245 seconds]
Timzi has left #lisp ["ERC (IRC client for Emacs 26.1)"]
regreg has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
svillemot has quit [Quit: ZNC 1.6.5+deb1+deb9u1 - http://znc.in]
<makomo> is it possible to use slime's in-place expansion features to expand local macros such as macrolets?
svillemot has joined #lisp
Denommus` has joined #lisp
Denommus has quit [Ping timeout: 245 seconds]
<phoe> makomo: yes
fikka has joined #lisp
<phoe> (macrolet ((foo (x) `(+ 2 ,x))) (foo 2))
<phoe> with cursor on the last "foo" I get the correct expansion, (macrolet ((foo (x) `(+ 2 ,x))) (+ 2 2))
fikka has quit [Read error: Connection reset by peer]
<makomo> hmm, nothing happens for me
<makomo> using SLIME 2.22
wigust has quit [Ping timeout: 246 seconds]
<makomo> i'm using slime-macroexpand-all-inplace btw
azimut has quit [Ping timeout: 245 seconds]
random-nick has quit [Ping timeout: 245 seconds]
<makomo> slime-macroexpand-all works when my point is on the top-level form
pierpal has quit [Ping timeout: 244 seconds]
<phoe> macrostep-expand
<phoe> that's what I use
lumm has quit [Quit: lumm]
azimut has joined #lisp
<makomo> hmm, i'll have to check out all of the different macroexpansion functions slime provides
FreeBirdLjj has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 252 seconds]
azimut has quit [Ping timeout: 244 seconds]
existential1 has joined #lisp
bradcomp has joined #lisp
azimut has joined #lisp
wigust has joined #lisp
it3ration has joined #lisp
it3ration has quit [Remote host closed the connection]
it3ration has joined #lisp
fikka has joined #lisp
russellw has joined #lisp
<trittweiler> jmercouris, See pop-n at https://pastebin.com/PQHv4YJU - this will destructively modify the input and not cons
<jmercouris> trittweiler: interesting approach, thanks for sharing
<trittweiler> it goes through the list twice, though. Should store (nthcdr (1- ,num) ,old-head) in a variable tmp, then bind ,new-head to (cdr ,tmp) and change the setf down there to (setf (cdr ,tmp) nil)
<makomo> place-based macros are really fun :D
<makomo> this library i found today has some cool ones if you want to take a look and have some fun: https://www.hexstreamsoft.com/libraries/place-utils
<makomo> phoe: seems like "macrostep" is the package i'm looking for (and the SLIME contrib which uses it, called slime-macrostep)
<makomo> slime can do it by itself, but only if you use one of the *-all variants and by placing your point on the whole macrolet form
<makomo> which isn't as neat because you can't do the expansion in steps obviously
j`ey has joined #lisp
<j`ey> is there a difference between (let ((n 0)), and (dotimes (n 1)..?
<Bike> dotimes has an implicit tagbody and stuff
<Bike> why?
<j`ey> Im seeing behaviour that suggest there is, just not sure why
<phoe> what do you mean?
<j`ey> well I would have expected the code to act the same between the two
<Bike> nope
<j`ey> or is that a wrong assumption?
<Bike> there's also an implicit block
rumbler31 has joined #lisp
<j`ey> what do you meant?
<phoe> you can't RETURN from a LET
<j`ey> *mean
<phoe> but you can RETURN from a DOTIMES
<j`ey> hm, looks like the other way around for me :P
<Bike> then you are mistaken
<Bike> (let ((n 0)) (return n)) => error
<j`ey> ohh
<Bike> a compile time warning, even
<j`ey> does RETURN inside DOTIMES only "return" to the scope of the dotimes?
<phoe> yes
<j`ey> ahh
<phoe> it returns to the scope of the most recently established block named NIL
<phoe> which is exactly what DOTIMES implicitly establishes
<no-defun-allowed> Hi Lithpers
<j`ey> before the return from the let* was returning from the function
<phoe> Hi no-dephun-allowed
<phoe> j`ey: actually it's not supposed to either
<j`ey> so is there a way to return from the entire function?
<phoe> DEFUN establishes a block named after the function
<Bike> (return-from name-of-function ...)
<phoe> (defun foo () (return-from foo 42) 24)
<j`ey> thanks
<phoe> (foo) ;=> 42
<Bike> your original code had something else going on, though
<Bike> since normally there'd be no NIL block
<j`ey> I have cond and let
<Bike> can i see?
<j`ey> and when and progn
<Bike> it returned from the outer dotimes.
<Bike> the (length moves) one.
<j`ey> oh right
rumbler31 has quit [Ping timeout: 252 seconds]
<j`ey> thanks, works now
<Bike> no problem.
dented42 has joined #lisp
jmercouris has quit [Ping timeout: 252 seconds]
v0|d has quit [Remote host closed the connection]
existential1 has quit [Quit: Leaving.]
iskander has quit [Ping timeout: 245 seconds]
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
lnostdal has quit [Read error: Connection reset by peer]
asarch has quit [Quit: Leaving]
<it3ration> I don't spose there are current bindings to vulcan / osx metal / et al for Common Lisp
<pjb> Is it not implemented in CL?
<pjb> Why not?
<pjb> Implement it in CL!
<AeroNotix> makomo: cool library
bradcomp has quit [Ping timeout: 240 seconds]
<makomo> AeroNotix: yeah, i like it :-)
sauvin has quit [Ping timeout: 245 seconds]
<AeroNotix> I've wrote some of those in the past and literally just wrote my own UPDATEF
sauvin has joined #lisp
<aeth> it3ration: You probably don't want to use Metal. Just use a Foo->Metal wrapper like https://moltengl.com/moltenvk/
Blukunfando has quit [Ping timeout: 252 seconds]
<aeth> Will Metal even still be around in 5 years?
<aeth> it3ration: As far as Vulkan goes, there's https://github.com/3b/cl-vulkan/ but it's incomplete because most people just use OpenGL via https://github.com/3b/cl-opengl/
<aeth> For Vulkan's added performance to matter and be worth it (in exchange for added complexity) you need a very large application.
<makomo> AeroNotix: WITH-RESOLVED-PLACES is also pretty cool, because it's basically ONCE-ONLY but for places -- it solves the multiple evaluation problem for subforms of a place
<aeth> it3ration: Just use OpenGL imo
<makomo> i wonder if a "better" name could have been chosen though, one similar to ONCE-ONLY
it3ration has quit [Ping timeout: 240 seconds]
<Bike> i'm not sure i understand how with-resolved-places is distinct from once-only
<makomo> it does part of the job of a setf expander for you
<j`ey> does CONTINUE work in DO-TIMES work like I would expect?
<Bike> nope.
<makomo> you don't have to manually call GET-SETF-EXPANSION, bind the exprs to temps, etc.
<Bike> that is, if how you expect is to go to the next loop iteration, like in a C loop.
<makomo> it does all of that for you, and just leaves you with the getter/setter forms
<Bike> makomo: i'd probably have to use it
<makomo> it's not correctly indented though
<makomo> so it threw me off the first time
<Bike> yeah, that was tripping me up
<j`ey> Bike: that's what I expected
<Bike> j`ey: usually we write loops so that continue isn't necessary- move conditions out, that kind of thing
<Bike> j`ey: if that's not in the cards for you, you can use the implicit tagbody
<Bike> (dotimes (...) ... (go continue) ... continue)
<j`ey> im just going to wrap the body in an if for now
<Bike> yeah, that's what i mean.
<Bike> i'd prefer that to the tagbody.
pierpa has joined #lisp
mange has joined #lisp
pierpal has joined #lisp
pierpal has quit [Ping timeout: 240 seconds]
<AeroNotix> makomo: so glad I found this library! There are a few macros I wanted to write myself but couldn't be bothered ;)
it3ration has joined #lisp
<makomo> AeroNotix: :-)
existential1 has joined #lisp
rpg has joined #lisp
it3ration has quit [Ping timeout: 245 seconds]
<phoe> so
<phoe> this morning I found an olllld WordNet library
<phoe> this evening I have a functioning Qtools interface to its modernized and bugfixed version
<phoe> I consider this to be a good day
<phoe> good night, #lisp
<no-defun-allowed> night phoe
quazimodo has quit [Ping timeout: 252 seconds]
Oladon has quit [Quit: Leaving.]
quazimodo has joined #lisp
<makomo> phoe: that's awesome. good night :-)
razzy has quit [Ping timeout: 244 seconds]
fikka has quit [Ping timeout: 240 seconds]
it3ration has joined #lisp
fikka has joined #lisp
phenoble has quit [Ping timeout: 264 seconds]
astalla has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 245 seconds]
emaczen has quit [Read error: Connection reset by peer]
Kaisyu has joined #lisp
phenoble has joined #lisp
Copenhagen_Bram has quit [Read error: Connection reset by peer]
fikka has joined #lisp