dlowe has quit [Remote host closed the connection]
pillton has joined #commonlisp
selwyn has quit [Read error: Connection reset by peer]
cjb has quit [Quit: rcirc on GNU Emacs 28.0.50]
cjb has joined #commonlisp
CrashTestDummy3 has joined #commonlisp
CrashTestDummy2 has quit [Ping timeout: 250 seconds]
wheelsucker has quit [Remote host closed the connection]
waleee has quit [Ping timeout: 250 seconds]
beach` has joined #commonlisp
beach has quit [Ping timeout: 240 seconds]
notzmv has quit [Read error: Connection reset by peer]
notzmv has joined #commonlisp
notzmv is now known as zimmybot
zimmybot is now known as notzmv
Demosthenex has joined #commonlisp
Demosthe1ex has quit [Ping timeout: 250 seconds]
semz has quit [Ping timeout: 250 seconds]
semz has joined #commonlisp
Guest29 has quit [Ping timeout: 246 seconds]
abrantesasf has quit [Quit: Leaving]
beach` is now known as beach
<beach>
Good morning everyone!
semz has quit [Ping timeout: 250 seconds]
doyougnu has quit [Ping timeout: 240 seconds]
notzmv has quit [Remote host closed the connection]
semz has joined #commonlisp
notzmv has joined #commonlisp
<kakuhen>
Is babel the recommended library for parsing utf-8?
<beach>
What's wrong with READ-CHAR?
<kakuhen>
Rather than making my own inferior decoder, I'd rather use one that already exists and does the right thing
<moon-child>
beach: portability, presumably
elf_fortrez has joined #commonlisp
<moon-child>
kakuhen: utf8 decoding is 10 lines of code, if that; it's hard to make it 'inferior'
<moon-child>
alright, my decoder is 18 bytes. So more than 10, but not by much
<elf_fortrez>
tower of hanoi in CL
<beach>
elf_fortrez: Is that a question?
<semz>
there are some pitfalls in utf-8 actually, such as overlong encodings and surrogate handling
<semz>
the format is deceptive
<moon-child>
an overlong encoding is just an invalid initial byte.
<moon-child>
surrogates are just in utf16 afaik
<beach>
kakuhen: If you have a good Common Lisp implementation, READ-CHAR should work.
<kakuhen>
So major implementations make their own extension to READ-CHAR for this?
<beach>
Extension?
<kakuhen>
Or are you hinting at the possibility to do this myself with READ-CHAR
<Bike>
if you're reading from a stream you can set the external format to be utf-8, probably.
<beach>
You just make sure your input stream has the right encoding when you open it.
<Bike>
if you just have a bytevector you probably do need a decoder like babel.
<semz>
moon-child: It's not just initial bytes. Code points must be encoded with the minimal number of bytes, so e.g. #\Nul must be encoded as #x00, rather than #xC0 #x00
<semz>
they're explicitly not allowed, and for good reason imo
akoana has quit [Quit: leaving]
<semz>
but it does take away from the elegance of the idea behind UTF-8
elf_fortrez has left #commonlisp [#commonlisp]
elf_fortrez has joined #commonlisp
<beach>
kakuhen: Maybe you should describe your use case. If you have SBCL and your encoding is located in a text file, you should be able to open the file and just read characters.
<kakuhen>
ok, looks like read-char supports unicode on my cl implementation
<semz>
...which seems like a common pattern in Unix land, come to think of it. "Simple and elegant, as long as you ignore the edge cases"
<kakuhen>
I wasn't aware read-char was able to do this on modern implementations, since I mostly take clhs at face value, and a little birdie once told me people often just use a library for unicode in cl.
<Bike>
i think that's a common pattern in literally anything.
<kakuhen>
oh actually my output is now confusing me
<kakuhen>
how the hell did my invocation of file-position work
<kakuhen>
I naively used (file-position stream 2) to place the offset at the start of the third character
<hayley>
I would definitely reject UTF-8 text with bogus continuation bytes.
<hayley>
Remember what Linus Torvalds said to do with the GNU coding style guide? I would do that with Postel's law. Just sayin'.
<semz>
I tend to agree.
<kakuhen>
beach: my use case is just to be able to read UTF-8 coded numbers from a binary file
<kakuhen>
I think READ-CHAR will work for this purpose, assuming that I have the correct offset.
<beach>
kakuhen: Then, yes, READ-CHAR should be fine.
<elf_fortrez>
is treaming the inpult and output at the same time the best solution?
taiju has joined #commonlisp
<elf_fortrez>
is writing a utf-8 in Common Lisp hard
<elf_fortrez>
utf-8 decoder
<hayley>
No, but you shouldn't need to do that.
<elf_fortrez>
then what function could he use?
<hayley>
As beach said, READ-CHAR will work fine.
<elf_fortrez>
bam i got it
<elf_fortrez>
thank you
Oladon has joined #commonlisp
Inline has quit [Quit: Leaving]
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
cjb has quit [Quit: rcirc on GNU Emacs 28.0.50]
Bike has quit [Quit: sleep]
semz has quit [Ping timeout: 250 seconds]
srhm has quit [Read error: Connection reset by peer]
khrbt has quit [Ping timeout: 250 seconds]
semz has joined #commonlisp
khrbt has joined #commonlisp
shka has joined #commonlisp
elf_fortrez has quit [Quit: Client closed]
kakuhen has quit [Remote host closed the connection]
kakuhen has joined #commonlisp
kakuhen_ has joined #commonlisp
kakuhen_ has quit [Remote host closed the connection]
kakuhen_ has joined #commonlisp
kakuhen has quit [Ping timeout: 240 seconds]
contrapunctus has left #commonlisp [#commonlisp]
semz has quit [Ping timeout: 250 seconds]
contrapunctus has joined #commonlisp
pillton has quit [Ping timeout: 256 seconds]
semz_ has joined #commonlisp
kakuhen_ has quit [Quit: Leaving...]
kakuhen has joined #commonlisp
twi has joined #commonlisp
contrapunctus has left #commonlisp [#commonlisp]
contrapunctus has joined #commonlisp
twi is now known as bothillinois
shka has quit [Ping timeout: 240 seconds]
slyrus has joined #commonlisp
pillton has joined #commonlisp
[deleted] has joined #commonlisp
lisp-newbie has joined #commonlisp
livoreno has quit [Ping timeout: 240 seconds]
elf_fortrezz has joined #commonlisp
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
elf_fortrezz has quit [Quit: Client closed]
Oladon has quit [Quit: Leaving.]
MichaelRaskin has quit [Quit: MichaelRaskin]
rgherdt has joined #commonlisp
paulman has quit [Remote host closed the connection]
lisp-newbie has quit [Quit: This computer has gone to sleep]
lisp-newbie has joined #commonlisp
lisp-newbie has quit [Remote host closed the connection]
lisp-newbie has joined #commonlisp
lisp-newbie has quit [Remote host closed the connection]
lisp-newbie has joined #commonlisp
lisp-newbie has quit [Remote host closed the connection]
<moon-child>
hayley: neh, that's fair
rain3 has joined #commonlisp
<moon-child>
though, I think it depends a lot on the domain, and the nature of the data you're processing. Utf8 decoder should (generally) not crash on invalid input, but put a substitution character or utf8-c8 nonsense. There still _are_ a lot of documents that are actually encoded in iso8559 or w/e, and the consequences of accepting a malformed utf8 stream are highly unlikely to be terrible
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
pve has joined #commonlisp
<pjb>
moon-child: there are security implications is accepting malformed utf-8 sequences. Modern protocols reject and close the connection when a field that should be in utf-8 cannot be decoded properly. (eg websockets rfc6455).
scymtym has quit [Ping timeout: 252 seconds]
lisp123 has joined #commonlisp
pillton has quit [Quit: ERC (IRC client for Emacs 27.2)]
hendursa1 has joined #commonlisp
hendursaga has quit [Ping timeout: 244 seconds]
perrierjouet has quit [Ping timeout: 250 seconds]
john__ has quit [Ping timeout: 250 seconds]
scymtym has joined #commonlisp
esb has quit [Remote host closed the connection]
perrierjouet has joined #commonlisp
<susam>
pjb: Thanks for sharing that comment on malformed utf-8 sequences.
<lisp-newbie>
Hi, I'm using a package that defines a generic and some methods. I created a method to deal with a specific object. Now how can I make it so that the algorithm that calls the methods uses mine? see here encode-json https://github.com/hankhero/cl-json/blob/master/src/encoder.lisp
<lisp-newbie>
Bike are you here?
<lisp-newbie>
this was yur suggestion yesterday, I now learned a bit about methods and generics, thanks! exactly what I need, if it works it's a very simple solution
didi has left #commonlisp [O bella ciao bella ciao bella ciao, ciao, ciao.]
<lisp-newbie>
*by package read system
<lisp-newbie>
the idea I had was to use (in-package :json) and then back (in-package :my-own-package)
<lotuseater>
lisp-newbie: you can import to your package the symbols from the :json package you need
<beach>
lotuseater: I recommend against importing symbols.
<beach>
lisp-newbie: Bike is probably asleep. And if you can maybe give a smaller example for your question, or point to a particular method in that file, that would help.
<lotuseater>
beach: right, I didn't mean exactly using :import-from
<lisp-newbie>
lotuseater I created the method already, I just want it that when I call json:encode-json it should call my method when it happens to find an object of class whatever
<lisp-newbie>
beach lotuseater yeah one sec, making a pastebin
<beach>
lisp-newbie: It will call your method if you give it an argument that is an instance of the particular class you specialied your method to.
<lotuseater>
ah okay
<beach>
lisp-newbie: But then you said "a specific object" and I don't see any trace of that in your code.
<beach>
lisp-newbie: Because that would mean an "EQL specializer" and I don't see one.
<lisp-newbie>
beach yeah, you are right. I meant when a object of a specific class is called, I want my own method to do it. not cl-json's generalized clos method
<beach>
lisp-newbie: That method will be called if you pass it an instance of the class LOCAL-TIME:TIMESTAMP.
<lisp-newbie>
beach even if it's in a different package?
<beach>
lisp-newbie: Wow, hold on a sec...
<lisp-newbie>
b/c it didn't seem to work for me... now if I change the package it seems to be working though I get no result not sure why...
<beach>
lisp-newbie: The only object that are called are functions. And I don't think that's what you mean.
<beach>
lisp-newbie: Also, packages matter mostly just to the reader.
<beach>
lisp-newbie: Just create an instance of that class and you are fine.
<lisp-newbie>
beach ok will try
<beach>
It is possible that the DEFGENERIC form and the DEFMETHOD form are in different packages?
<beach>
If so, you have two generic functions with two different names, but the names (i.e., the symbols naming them) have the same SYMBOL-NAME but different values of SYMBOL-PACKAGE.
<beach>
Does that make sense to you?
lsip123_` has quit [Read error: Connection reset by peer]
lsip123_` has joined #commonlisp
kulernil has joined #commonlisp
Krystof has quit [Ping timeout: 252 seconds]
<lisp-newbie>
beach I don't really understand
<lisp-newbie>
sorry for the late reply, trying to test this...
paulman has quit [Remote host closed the connection]
dac has joined #commonlisp
dcx has quit [Ping timeout: 252 seconds]
<beach>
lisp-newbie: Is it the case that, when things don't work, your DEFGENERIC form and your DEFMETHOD form are in two different files with two different IN-PACKAGE forms at the beginning?
<beach>
lisp-newbie: If so, and if your DEFGENERIC form is in package A and your DEFMETHOD form is in package B, then your DEFMETHOD form will implicitly create a generic function named B:ENCODE-JSON, whereas you DEFGENERIC form created a generic function named A:ENCODE-JSON.
<lisp-newbie>
beach yes
<beach>
lisp-newbie: Any symbol you find in a file with an (IN-PACKAGE #:MUMBLE) will be in package #:MUMBLE, except for symbols that are imported.
<lisp-newbie>
exactly, so what can I do? my defmethod is in :my-package and the defgeneric encode-json is in cl-json:encode-json
<beach>
So you do (defmethod cl-json:encode-json ...) instead of (defmethod encode-json ...).
<lisp-newbie>
beach so I should import it? and by importing do you mean :import-from or :use? I've tried to stick to :import-from from what I read to avoid naming conflicts
<beach>
NOOOOOOOOOOO!
<lisp-newbie>
ahhhh wow, never would have thought of that
<lisp-newbie>
thanks
<beach>
Sure.
<beach>
You can refer to any exported symbol in any existing package by giving a package prefix.
<lotuseater>
beach: That's also helpful when shadowing symbols but when you then need them at some points.
<beach>
You are telling me? I do that all the time. The Cluffer library has symbols named FDEFINITION, FIND-CLASS, etc. and we occasionally need to refer to the symbols with those names in the CL package.
<jmercouris>
hm, I never thought of just not using CL in a package
<jmercouris>
:USE to be clear
<jmercouris>
I guess there could be a reason to do it
<beach>
We do :USE the CL package, be we often choose to shadow some symbols.
<jmercouris>
I see, so you just shadow them
<beach>
Yes.
<jmercouris>
it's been a while since i've looked at cluffer
<lotuseater>
No of course I'm not telling.
<beach>
Ooops, I meant Clostrum, not Cluffer.
<beach>
Because Clostrum manages first-class global environments
<beach>
So it is normal that it has names that are the same as some CL names, because the functions do similar things.
<jmercouris>
ah, that makes much more sense
<jmercouris>
I was wondering why those would have been shadowed in cluffer
<beach>
Yeah, sorry.
<jmercouris>
but I figured there was some esoteric reason I did not know :-D
<beach>
So there is a generic function (defgeneric fdefinition (client environment function-name) ...) that returns the function with the given name in the given environment.
<beach>
It would be silly to try to name it something else, when that is precisely what it does.
<jmercouris>
agreed
<beach>
Same with MACRO-FUNCTION, COMPILER-MACRO-FUNCTION, FIND-CLASS, etc.
<lisp-newbie>
wohooo!! :D thank you beach and lotuseater :D now working
<beach>
Pleasure.
elf_fortrez has quit [Ping timeout: 246 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
lisp-newbie has quit [Quit: This computer has gone to sleep]
Cymew has quit [Ping timeout: 250 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<lotuseater>
erm okay but I didn't say anything useful ._.
random-nick has joined #commonlisp
kakuhen has quit [Quit: Leaving...]
doyougnu has joined #commonlisp
doyougnu has quit [Quit: ERC (IRC client for Emacs 28.0.50)]
selwyn has joined #commonlisp
<hayley>
Today I found out that SBCL has a SB-LOCKLESS package, which (at least?) has an implementation of a lock-free linked list. Does anyone use it? I can't find a use in SBCL, but I didn't look too hard.
selwyn has quit [Remote host closed the connection]
selwyn has joined #commonlisp
lsip123_` has quit [Remote host closed the connection]
amb007 has quit [Read error: Connection reset by peer]
<jmercouris>
haylely: rgrep QL
amb007 has joined #commonlisp
doyougnu has joined #commonlisp
<hayley>
Yeah, thanks. I'll just download everything in Quicklisp to find out. But there don't seem to be any hits on GitHub for it.
<jmercouris>
the only thing I see is lparallel using a lockless queue
<jmercouris>
on first inspection it does not apepar they are using SBCL's package
<jmercouris>
yeah, I can't find anything else
<jmercouris>
you may have better luck with a more populated QL than mine, I only looked at what I had already used
dlowe has joined #commonlisp
<hayley>
Earlier I was aware of a mostly lock-free hash table in SBCL, but that is at least used for packages.
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<_death>
grepping sbcl shows some uses.. it's an internal package so not meant to be used by other projects
<_death>
although there's no actual construction of such lists, so my next guess is that it's used in google's Lisp code..
<hayley>
I can't seem to find any uses in SBCL though. The GC and SAVE-LISP-AND-DIE have to be careful around it (as it uses lowtags for "mark bits"), but - yeah, nothing really "uses" it.
<lotuseater>
_death: where's that Lisp code at Google you speak of?
<lisp123>
Hopefully it stays big, when travel rebounds - Google should get a good pickup
semz has quit [Ping timeout: 250 seconds]
didi has joined #commonlisp
rain3 has quit [Ping timeout: 240 seconds]
<didi>
This is curious: Compiling (defmethod foo (x) (with-slots (h) x (loop for v being each hash-value in h sum v))) with C-c C-c in SLIME under SBCL I get the following style warning: "Can't preserve function source - missing MAKE-LOAD-FORM methods?"
moon-child has quit [Remote host closed the connection]
<didi>
beach: Am I using `with-slots' wrong?
<beach>
No, apparently not.
<didi>
Ah, ok.
<_death>
didi: I don't get this here.. what sbcl version?
<didi>
_death: "2.0.1.debian"
<_death>
maybe try a more recent version
<didi>
_death: Thanks. Tho I might write it without LOOP to avoid the warning.
shka has joined #commonlisp
<hayley>
I don't think that warning has to do with any code you wrote.
moon-child has joined #commonlisp
<didi>
hayley: Well, it's that code which triggers it.
<contrapunctus>
I can't start seem to start a SLIME REPL of late (was working fine earlier) - on the first attempt I got END-OF-FILE for swank.fasl, and on the second attempt I got "The function SWANK::INIT is undefined." - http://ix.io/3wPs
<hayley>
didi: Does it not occur for any other function?
<didi>
hayley: Not until now, no.
<hayley>
Or for any other DEFMETHOD form, or anything else?
<didi>
Nope.
lisp-newbie has quit [Quit: Leaving]
<hayley>
Weird.
<didi>
It's just curiosity. As _death said, it doesn't occur on a more recent version.
<contrapunctus>
I've tried searching for the error, and `apt reinstall sbcl`. No change...
<_death>
have you tried deleting the fasls
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #commonlisp
semz has joined #commonlisp
<recordgroovy>
I've never seen the LOOP phrase "being each hash-value in h"... is there a difference between "in" and "of"?
<Bike>
don't think so, at least in that context
<contrapunctus>
_death: I moved the `fasls` directory to `fasls.bak`...that did not end well. http://ix.io/3wPw
rain3 has joined #commonlisp
<didi>
recordgroovy: Nope. "each|the" and "on|in" are just for grammar.
<didi>
Eer, "of|in".
* didi
is not great on grammar
dilated_dinosaur has quit [*.net *.split]
Fade has quit [*.net *.split]
mfiano has quit [*.net *.split]
micro has quit [*.net *.split]
Oddity has quit [*.net *.split]
lukego has quit [*.net *.split]
travv0 has quit [*.net *.split]
jhi has quit [*.net *.split]
conjunctive has quit [*.net *.split]
cross has quit [*.net *.split]
sm2n has quit [*.net *.split]
energizer has quit [*.net *.split]
edgar-rft has quit [*.net *.split]
zagura has quit [*.net *.split]
clemens3 has quit [*.net *.split]
Patternmaster has quit [*.net *.split]
remexre has quit [*.net *.split]
zephyr has quit [*.net *.split]
<_death>
contrapunctus: maybe try cloning the slime repo from github instead of using the elpa version, and make sure it's the only copy
<contrapunctus>
Tried to `M-x package-reinstall RET slime RET` and start a new SBCL...that worked!
<contrapunctus>
_death: thanks :)
v88m has quit [Ping timeout: 250 seconds]
clemens3 has joined #commonlisp
energizer has joined #commonlisp
Patternmaster has joined #commonlisp
edgar-rft has joined #commonlisp
micro has joined #commonlisp
sm2n has joined #commonlisp
zagura has joined #commonlisp
remexre has joined #commonlisp
zephyr has joined #commonlisp
cross has joined #commonlisp
Oddity has joined #commonlisp
dilated_dinosaur has joined #commonlisp
travv0 has joined #commonlisp
conjunctive has joined #commonlisp
mfiano has joined #commonlisp
jhi has joined #commonlisp
Fade has joined #commonlisp
lukego has joined #commonlisp
v88m has joined #commonlisp
recordgroovy has quit [Ping timeout: 240 seconds]
semz has quit [Ping timeout: 250 seconds]
v88m has quit [Ping timeout: 250 seconds]
semz has joined #commonlisp
attila_lendvai has quit [Quit: Leaving]
attila_lendvai has joined #commonlisp
semz has quit [Ping timeout: 250 seconds]
theBlackDragon has quit [Ping timeout: 245 seconds]
attila_lendvai has quit [Quit: Leaving]
attila_lendvai has joined #commonlisp
semz has joined #commonlisp
attila_lendvai has quit [Client Quit]
attila_lendvai has joined #commonlisp
Inline has joined #commonlisp
theBlackDragon has joined #commonlisp
prxq has joined #commonlisp
sgithens has quit []
sgithens has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
livoreno has quit [Ping timeout: 240 seconds]
yitzi has joined #commonlisp
livoreno has joined #commonlisp
karlosz has joined #commonlisp
palter has quit []
palter has joined #commonlisp
recordgroovy has joined #commonlisp
Cymew has quit [Ping timeout: 252 seconds]
yitzi has quit [Remote host closed the connection]
Cymew has joined #commonlisp
pl has quit []
pl has joined #commonlisp
lisp123 has quit [Quit: Leaving...]
Josh_2 has joined #commonlisp
Cymew has quit [Ping timeout: 250 seconds]
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
ahc has quit [Quit: Client closed]
hendursaga has quit [Remote host closed the connection]
hendursaga has joined #commonlisp
dlowe_ has joined #commonlisp
cage has joined #commonlisp
<jcowan>
hayley: Postel's Law makes sense for display programs: if your browser always said "HTML validity error" and nothing else, you'd quickly dispose of it in favor of another browser that is liberal in what it accepts.
dlowe_ has quit [Remote host closed the connection]
attila_lendvai has quit [Quit: Leaving]
rowanthorpe has quit [Ping timeout: 250 seconds]
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
cranium has joined #commonlisp
cranium has quit [Client Quit]
cosimone has joined #commonlisp
cranium has joined #commonlisp
stylewarning has quit []
stylewarning has joined #commonlisp
makomo has quit [Ping timeout: 240 seconds]
Lycurgus has joined #commonlisp
silasfox has joined #commonlisp
yitzi has joined #commonlisp
silasfox has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
v88m has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
silasfox has joined #commonlisp
cosimone has quit [Ping timeout: 250 seconds]
cuz has joined #commonlisp
jeosol has quit [Quit: Connection closed]
ec_ has quit [Ping timeout: 244 seconds]
Krystof has joined #commonlisp
ec_ has joined #commonlisp
jeosol has joined #commonlisp
Guest42 has joined #commonlisp
ln43 has joined #commonlisp
<ln43>
Hi all... i'm downloading a book edited for the first time in the 1995 about CL ,... hoping that the reading will be pleasant
PinealGlandOptic has joined #commonlisp
<hexology>
which book?
lisp123 has joined #commonlisp
<ln43>
Artificial Intelligence: A Modern Approach (Stuart Russell, Peter Norvig)
<ln43>
basically i was looking for a decent implementation of a* used for search and i found this site: http://www.ccs.neu.edu/home/rjw/csg120/ which was pointing as a textbook to that one
<ln43>
the reason was that i really don't liked the approach used in another book
selwyn has quit [Read error: Connection reset by peer]
<_death>
it's a great book, but not about CL.. the authors did write some CL code to go along with the book
<ln43>
but ok, to be honest i should start understanding the pseudocode before cnsidering the "style" ... anyway since i'm trying to getting used to the language i would like to find a decent way to express the concepts using CL
<ln43>
so if there is any possible suggestion it's welcome
<didi>
ln43: PAIP is a classic.
<_death>
before AIMA, Norvig wrote a much more CL-centric book called Paradigms of AI Programming
<didi>
ln43: ^
cognemo has joined #commonlisp
<ln43>
ok... thanks, so i should try to get that book
<phantomics>
The 'fixnum type is causing a problem. Any thoughts?
<lotuseater>
ohai phantomics :)
<phantomics>
What's up lotuseater
<lotuseater>
just wanted to say hi if it doesn't annoy
<phantomics>
Btw what version of SBCL are you using April under?
<lotuseater>
hm what does the source for rotate say?
<lotuseater>
on the new laptop with Manjaro I'm now on 2.1.7
<lotuseater>
could try now
ec_ has quit [Ping timeout: 244 seconds]
cosimone has joined #commonlisp
<phantomics>
It uses the CL replace function which is where the problem comes from
<phantomics>
Ok, I just upgraded to 2.1.7, could you run (april (test)) and let me know how much time it says it takes?
<_death>
phantomics: I'd expect the first form to give problems, since you're passing a literal to a destructive operator.. the second works for me
azimut has quit [Ping timeout: 244 seconds]
<lotuseater>
yes it says -1 not of type SB-INT:INDEX when binding SB-VM::NELEMENTS
<phantomics>
_death: are you using 2.1.7?
<phantomics>
lotuseater: same problem I'm having
<lotuseater>
yes, do I have to wrap it into (time ...) ?
<_death>
I'm using HEAD
<phantomics>
No, (april (test)) will give you the time elapsed at the end
attila_lendvai has joined #commonlisp
<lotuseater>
and on CCL? how does it behave there?
<phantomics>
Haven't tried yet
<lotuseater>
okay
<phantomics>
When I switched from 2.0.2 to 2.1.7, April's compiler seems to work 100x slower
<phantomics>
_death: ok, maybe it was a bug that just got fixed
doyougnu has joined #commonlisp
<lotuseater>
4 of 904 tests failed (129995ms)
<phantomics>
Ok, that long duration is that I'm seeing
<lotuseater>
hmmm
<phantomics>
Under 2.0.2 I was seeing exec times around 100ms for the tests, so it's a cause for concern
<phantomics>
And those 4 failed tests are because of the (rotate) bug
<lotuseater>
yes I expected that
selwyn has joined #commonlisp
<phantomics>
I wonder if the new version has some kind of type-checking that wasn't present before and is producing this massive slowdown
ec_ has joined #commonlisp
khrbt has quit [Ping timeout: 240 seconds]
ln43 has quit [Quit: Connection closed]
khrbt has joined #commonlisp
john__ has joined #commonlisp
<_death>
heh, apparently april expects lparallel:*kernel* to be a kernel instance (or null).. in my case I extended it to be a kind of a "kernel designator" so holds a function initially.. but if I set it to nil then (april (test)) => ✓ 914 tests completed (123331ms)
<phantomics>
So you customized your lparallel?
<phantomics>
A direct way to test the bug is (REPLACE #(3 1) #(3 1) :START1 1 :START2 0)
<phantomics>
If those #(3 1) vectors are t-type, it works, but if they're 'fixnum it fails
<_death>
again, you are passing a literal to a destructive operator
<phantomics>
I know, this is for the purposes of a test
karlosz has quit [Quit: karlosz]
<_death>
what test would that be? the consequences are undefined
<phantomics>
Checking whether the (replace) causes a bug
<phantomics>
In your HEAD it seems not to, lotuseater and I are trying in 2.1.7 and it does
<lotuseater>
and with floats or specializable unsigned-bytes?
<phantomics>
The type is fixnum
<lotuseater>
right but if it's one of the others when doing with rotate
<phantomics>
I tried changing the vector to be t-type and it now works, but it seems strange that (replace) won't work on a fixnum vector
<_death>
if it's a change you made, bisect april :)
attila_lendvai has quit [Ping timeout: 252 seconds]
makomo has quit [Ping timeout: 240 seconds]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]
cosimone has joined #commonlisp
<phantomics>
Changing that vector from fixnum to t-type solves the problem for now
cranium has quit [Ping timeout: 250 seconds]
scymtym has quit [Ping timeout: 250 seconds]
karlosz has joined #commonlisp
attila_lendvai has joined #commonlisp
shka has quit [Ping timeout: 250 seconds]
ec_ has quit [Ping timeout: 244 seconds]
silasfox has quit [Ping timeout: 240 seconds]
ec_ has joined #commonlisp
yitzi_ has joined #commonlisp
yitzi has quit [Ping timeout: 240 seconds]
joe_mad has joined #commonlisp
travv0 has quit []
travv0 has joined #commonlisp
easye has quit [Remote host closed the connection]
scymtym has joined #commonlisp
scymtym has quit [Remote host closed the connection]
scymtym has joined #commonlisp
pve has quit [Quit: leaving]
yitzi has joined #commonlisp
yitzi_ has quit [Read error: Connection reset by peer]
jsatk has quit []
silasfox has joined #commonlisp
jsatk has joined #commonlisp
<recordgroovy>
Quick question: some libraries use special variables like cl-json:*json-stream* for consumers to dynamically bind to. Is there a way for consumers to do some form of package-wide dynamic binding, like a toplevel setf, without overriding settings from other dependents?
lottaquestions has joined #commonlisp
<Bike>
packages are just namespaces. they're not involved with anything like that. what do you have in mind exactly? Like when you call any function named by a symbol in your package it binds a dynamic variable?
mjoerg has quit [Remote host closed the connection]
mjoerg has joined #commonlisp
livoreno has quit [Read error: Connection reset by peer]
ec_ has joined #commonlisp
<lisp123>
I wonder if symbol-let might help here
<Bike>
what is symbol-let?
<moon-child>
meant symbol-macrolet, maybe?
mjoerg has quit [Remote host closed the connection]
CrashTestDummy2 has joined #commonlisp
<pjb>
recordgroovy: your question is incomprehensible. What does "overriding settings from other dependents" mean? what are those settings? what are those other dependents? What do they depend on?
mjoerg has joined #commonlisp
<recordgroovy>
pjb: You have packages A and B that both depend on cl-json, and both have a toplevel `(setf cl-json:*json-output* something-or-other)` -- conflict. The usual workaround is a `let`, but if you're calling the dependent library in multiple parts it can get unwieldy
akoana has joined #commonlisp
amb007 has quit [Ping timeout: 240 seconds]
CrashTestDummy3 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
<recordgroovy>
I wanted to know if there was any feature that looked like a toplevel setf to the programmer, but behaved like you're wrapping an entire chunk of code under a let.
<pjb>
recordgroovy: does function in package A call a function in package B?
<recordgroovy>
They're both independent and know nothing of each other
<pjb>
dynamic binding = time. ie WHEN you call (a:foo) with the dynamic binding, then DURING that call, it will be visible to any function (a:foo) calls.
<Bike>
okay, but let me ask again - say you have like (let ((cl-json:*json-output* ...)) (defun foo ...)). then in a call to foo that variable won't actually be bound.
<Bike>
that's what wrapping a regular system file in a let would be like, but I don't think you want that.
<recordgroovy>
That's fair -- I guess a let over each cl-json call would be the answer here.
<pjb>
recordgroovy: (let ((json:*output* 'something)) (a:foo)) ; but if a:foo doesn't call any b:bar, and you call b:bar at another time, (or from another thread, subject to some thread configuration), then the binding won't be seen while (b:bar) is executing.
<Bike>
every call in your library, right? you could define some small wrappers. (defun encode-json (object) (json:encode-json object *my-stream*))
<pjb>
recordgroovy: check the :initial-bindings parameter of bt:make-thread
<pjb>
recordgroovy: and bt:*default-special-bindings*
<pjb>
recordgroovy: but note that dynamic variables are specifically designed to have this behavior, of having their binding visible by all the functions called DURING their bindings. If you don't want that, then you don't want a dynamic variable.
<pjb>
recordgroovy: if the cl-json library didn't want that, then they would have used a global lexical variable (which can be implemented using define-symbol-macro, which is a global lexical binding).
<recordgroovy>
right, got it
<pjb>
recordgroovy: similarly for your own functions in packages A and B. You could use lexical variables to hold the different values, and bind json:*json-output* just around the calls to json:functions
<pjb>
recordgroovy: also the lexical aspect is not necessary, you could just have global (dynamic) variables in A and in B, and bind json:*json-output* just around the calls to json:functions.
<pjb>
so even if you can some function of package B in functions of package A, since you rebind *json-output* each time you call json:stuff, you can have a different output in each package.
<pjb>
note that usually (well designed) libraries will have an optional or key parameter for such stream or output parameter, so you can write directly (json:stuff :output a:*out*) instead of binding json:*json-output*.
<pjb>
(the default value for this :output parameter being json:*json-output*)
lisp123 has quit [Quit: Leaving...]
doyougnu has quit [Remote host closed the connection]
mjoerg has quit [Remote host closed the connection]
cuz has quit [Ping timeout: 248 seconds]
john__ has quit [Ping timeout: 252 seconds]
makomo has joined #commonlisp
lisp123 has joined #commonlisp
john__ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 240 seconds]
cosimone has quit [Ping timeout: 250 seconds]
rgherdt has quit [Ping timeout: 240 seconds]
scymtym has quit [Ping timeout: 250 seconds]
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
makomo has quit [Ping timeout: 252 seconds]
joe_mad has left #commonlisp [ERC (IRC client for Emacs 26.3)]
lisp123 has quit [Ping timeout: 252 seconds]
psycomic has quit [Ping timeout: 240 seconds]
defaultxr has joined #commonlisp
lisp123 has joined #commonlisp
john__ has quit [Ping timeout: 240 seconds]
kakuhen has joined #commonlisp
yitzi has quit [Quit: Leaving]
random-nick has quit [Ping timeout: 250 seconds]
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
luna-is-here has quit [Remote host closed the connection]
selwyn has quit [Read error: Connection reset by peer]
luna-is-here has joined #commonlisp
edgar-rft has quit [Ping timeout: 268 seconds]
edgar-rft has joined #commonlisp
lisp123 has quit [Ping timeout: 240 seconds]
Qwnavery has joined #commonlisp
edgar-rft has quit [Ping timeout: 252 seconds]
edgar-rft has joined #commonlisp
dlowe has quit [Remote host closed the connection]