p_l changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | ASDF 3.3.4
cosimone has quit [Ping timeout: 246 seconds]
slyrus__ has joined #lisp
ebzzry_ has quit [Read error: Connection reset by peer]
slyrus_ has quit [Ping timeout: 246 seconds]
prince1 has joined #lisp
lemoinem has quit [Read error: Connection reset by peer]
lemoinem has joined #lisp
karlosz has quit [Quit: karlosz]
prince1 has quit [Ping timeout: 250 seconds]
prince1 has joined #lisp
iAmDecim has joined #lisp
KDr24 has joined #lisp
loli has joined #lisp
KDr23 has quit [Ping timeout: 250 seconds]
slyrus has quit [Quit: Leaving]
asarch has joined #lisp
Oladon1 has joined #lisp
Oladon has quit [Ping timeout: 246 seconds]
orivej has quit [Ping timeout: 256 seconds]
loli has quit [Quit: WeeChat 2.7.1]
loli has joined #lisp
isBEKaml has quit [Quit: leaving]
bitmapper has quit [Ping timeout: 250 seconds]
clothespin has quit []
easieste has joined #lisp
easieste has quit [Read error: Connection reset by peer]
KDr24 has quit [Remote host closed the connection]
akoana has joined #lisp
KDr24 has joined #lisp
mikecheck has joined #lisp
loli has quit [Quit: WeeChat 2.7.1]
loli has joined #lisp
vap1 has quit [Ping timeout: 264 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
iAmDecim has quit [Ping timeout: 250 seconds]
infra_red[m] has joined #lisp
karlosz has joined #lisp
iAmDecim has joined #lisp
Necktwi has quit [Read error: Connection reset by peer]
iAmDecim has quit [Ping timeout: 250 seconds]
semz has quit [Ping timeout: 246 seconds]
msk has joined #lisp
eschulte has quit [Remote host closed the connection]
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 256 seconds]
X-Scale` is now known as X-Scale
space_otter has joined #lisp
semz has joined #lisp
semz has quit [Changing host]
semz has joined #lisp
ebzzry_ has joined #lisp
iAmDecim has joined #lisp
swills has quit [Ping timeout: 256 seconds]
mikecheck has left #lisp ["part"]
swills has joined #lisp
<moon-child> I'm trying to make an accessor function for vectors. So you can say something like (vec2:dec v (format nil "(~a,~a)" x y)) instead of having to manually aref
<moon-child> I came up with this http://sprunge.us/hof6T2?cl, but it doesn't work because the x and y symbols are local to the 'vec2' package, and so hidden from whatever package is using the macro
<moon-child> how can I fix it?
<no-defun-allowed> Maybe you should let the client pick what symbols it wants bound.
<no-defun-allowed> Then I could write, say (dec (x1 y1) v1 (dec (x2 y2) v2 (make-vector (+ x1 x2) (+ y1 y2)))) to sum two vectors v1 and v2.
<moon-child> I don't want to do that
<moon-child> there will be a second form (vec2:dec (v u) (make-vector (+ x1 y1) (+ x2 y2))), which just adds increasing numbers to the parameters
<moon-child> but that doesn't work because just exposing symbols doesn't work
<moon-child> I see someone else did it like this https://github.com/mfiano/origin/blob/master/src/internal.lisp#L8. Is there a prettier way?
bilegeek has joined #lisp
torbo has quit [Remote host closed the connection]
_whitelogger has joined #lisp
<no-defun-allowed> Here is my intuition: (+ 1) = (+ 1 0) take 1 from both sides: (+) = (+ 0)
<oni-on-ion> (i am getting the same in sbcl)
<Bike> because - isn't defined in as regular a way
<no-defun-allowed> (* 2 1) = (* 2) take 2 from both sides: (* 2) = (*)
<Bike> (- x) = (negate x), (- x ...) = (+ x (- (+ ...)))
<no-defun-allowed> I can't think of anything like that which makes sense for -.
<oni-on-ion> you mean (* 1) = (*) ?
<no-defun-allowed> Ah yeah, my bad. (* 1) = (*)
<oni-on-ion> (/) also errors for the same reason as (-) [not enough args]
<Bike> it's defined in the same way. single arg is reciprocal, multi arg is multiplication with reciprocal
<oni-on-ion> oh, right
ebzzry_ has quit [Read error: Connection reset by peer]
<oni-on-ion> wait (/) and (-) are ?
<Bike> yes
<oni-on-ion> ok =)
<Bike> i just checked the guile manual and it defines - in the same way, so i don't think i understand why this question is coming from them
<Bike> too
<Bike> "If called with one argument z1, -z1 is returned. Otherwise the sum of all but the first argument are subtracted from the first argument. "
<aeth> They're defined inductively, and (*) and (+) can start at 0, so they do. (-) and (/) cannot because they start at 2 with special case behavior for length 1.
<aeth> (- x) has to behave the way it does because otherwise (- x) would be x and you'd need another function for negation and this would be syntactically counterintuitive
<oni-on-ion> i have no mouse and i wonder if i can paste those lines there , they seem to be having trouble with it and these clear it right up for me.
<aeth> I guess (/ x) is there because it's useful while (/ x) defined like (* x) would be useless
<aeth> (/ x) also parallels (- x) because (- x) is (- 0 x) and (/ x) is (/ 1 x) in other words (- x) is (- (+) x) and (/ x) is (/ (*) x)
<oni-on-ion> hmm cool =)
<aeth> It's actually mathematically very neat because the additive identity is (+) and the multiplicative identity is (*) so you never need any numbers!
Bike has quit [Quit: Lost terminal]
<aeth> You can build the numbers like (+), (+ (*)), (+ (*) (*)), ..., and now you have yet another way to construct numbers from first principles in Common Lisp
<akoana> true, and so (/ (*)) gives 1 and (- (+)) 0
<akoana> nice, indeed
<oni-on-ion> is this ok for me to share with #guile? -> http://ix.io/2eEc/text
<oni-on-ion> i wont say where its from
<aeth> sure?
* akoana thinks, Mr. Peano wouldn't care :)
<aeth> Completely pointless, but fun: (defun f (i) (labels ((g (j) (if (= j i) j (g (+ j (*)))))) (g (+))))
Khisanth has quit [Ping timeout: 250 seconds]
<oni-on-ion> no defun allowed! only serious work =)
<axion> moon-child: There is nothing ugly about my method. That function is called at compile-time for use inside symbol-macrolet to expand into aref calls. Alternatively you could just define your vector objects as structs with a vector :type, and slots to be specialized arrays, and a good implementation will produce nearly the same machine code as AREF for named accessors
<aeth> oni-on-ion: no defun? Well, okay. (setf (fdefinition 'f) (lambda (i) (labels ((g (j) (if (= j i) j (g (+ j (*)))))) (g (+)))))
<no-defun-allowed> oni-on-ion: No, there's two negatives. You're not allowed to de-fun.
<no-defun-allowed> i.e. d fun / d t must not be less than 0
<akoana> haha
<aeth> in case anyone is confused, it's just an obfuscation of (defun f (i) i) if f is a nonnegative integer... and an infinite loop if f is any other number :-p
<aeth> I probably should've, uh, restricted it
<aeth> well >= instead of = makes it (max 0 (ceiling i))
<akoana> aeth: thanks for the improvement, the previous version punished me with an infinite loop for negative input - maybe that was too rude ;)
<aeth> (defun f (i) (labels ((g (j) (if (>= j i) j (g (+ j (*)))))) (g (+))))
Khisanth has joined #lisp
<aeth> now hopefully (haltp #'f) => T
<akoana> thanks, verified ;)
<no-defun-allowed> (haltp #'haltp)
<aeth> no-defun-allowed: well? I'm waiting...
<no-defun-allowed> (haltp (labels ((f (x) (if (haltp #'x) (loop) x))) #'f))
<aeth> no-defun-allowed: T
<aeth> that just returns #<FUNCTION (LABELS F) {52DAA8EB}>
<aeth> :-)
<no-defun-allowed> (labels ((f (x) (if (haltp #'f x) (loop) x))) (f :maybe))
<aeth> akoana: more seriously, it's always good practice to do >= in loops rather than = and I just demonstrated why
<akoana> hmm, good point
<aeth> Fortunately, both :below and :to do so in LOOP, e.g. :from 100 :below 10 doesn't run, as expected, but :from 100 :to 10 doesn't infinite loop, which it might have with = semantics
<aeth> well, I hope that's not implementation-specific...
<aeth> also e.g. (loop :for i :from 1 :to 10 :by 5/3 :do (print i))
<aeth> with = semantics that's an infinite loop, too
<aeth> fortunately, it terminates
Necktwi has joined #lisp
<akoana> it's a sign of good design
shangul has joined #lisp
<aeth> and I'm guessing a cryptic, obfuscated use of LABELS is not good design? :-(
<akoana> lol, depends...
<akoana> ... on the design goal :)
ebzzry_ has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
<Josh_2> jackdaniel: very kewl :D
gravicappa has joined #lisp
KDr24 has quit [Remote host closed the connection]
KDr24 has joined #lisp
_whitelogger has joined #lisp
devrtz has quit [Ping timeout: 250 seconds]
iAmDecim has quit [Ping timeout: 246 seconds]
devrtz has joined #lisp
Bourne has joined #lisp
Lord_of_Life has quit [Read error: Connection reset by peer]
asarch has quit [Quit: Leaving]
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #lisp
gravicappa has quit [Ping timeout: 264 seconds]
Lord_of_Life has joined #lisp
<moon-child> axion: upon further examination of your solution (ignoring the string munging) it does look a lot prettier. But actually, I don't think it would work for my purposes; it requires you to pass in a symbol, so it knows the namespace of the caller
narimiran has joined #lisp
Bourne has quit [Read error: Connection reset by peer]
<beach> Good morning everyone!
iAmDecim has joined #lisp
EvW has joined #lisp
<Josh_2> Morning beach
_whitelogger has joined #lisp
patrixl has left #lisp [#lisp]
akoana has left #lisp ["Leaving"]
lansiir has joined #lisp
<no-defun-allowed> moon-child: I still think it would be better to allow the client to pick the symbols that they want bound.
oldtopman has quit [Ping timeout: 250 seconds]
<no-defun-allowed> How often do you dance in the shallows of a river?^W^W^W^W^W^W^W^W^W^W Maybe you could intern new symbols in the current package, if you're sure you want to do that.
<moon-child> heh
<moon-child> I'm the only consumer of my library, and I prefer the other usage. Also I figured it out: ,(read-from-string "x") seems to do what I want
<no-defun-allowed> clhs intern
EvW has quit [Ping timeout: 246 seconds]
efm has quit [Ping timeout: 256 seconds]
<no-defun-allowed> You might end up with a macro that looks like https://plaster.tymoon.eu/view/1710
shka_ has joined #lisp
<moon-child> ...pretty much, yah
orivej has joined #lisp
dddddd has quit [Ping timeout: 264 seconds]
Bourne has joined #lisp
bilegeek has quit [Quit: Leaving]
iAmDecim has quit [Ping timeout: 250 seconds]
KDr24 has quit [Remote host closed the connection]
KDr24 has joined #lisp
iAmDecim has joined #lisp
shka_ has quit [Ping timeout: 246 seconds]
flamebeard has joined #lisp
wilfredh has joined #lisp
efm has joined #lisp
srji has joined #lisp
ukari has quit [Ping timeout: 246 seconds]
efm has quit [Ping timeout: 256 seconds]
ukari has joined #lisp
efm has joined #lisp
random-nick has joined #lisp
_whitelogger has joined #lisp
varjag has joined #lisp
shangul has quit [Quit: Leaving]
X-Scale has quit [Ping timeout: 258 seconds]
X-Scale` has joined #lisp
X-Scale` is now known as X-Scale
gravicappa has joined #lisp
ukari has quit [Remote host closed the connection]
zmt01 has quit [Ping timeout: 256 seconds]
KDr24 has quit [Ping timeout: 264 seconds]
Josh_2 has quit [Ping timeout: 250 seconds]
mgsk has quit [Ping timeout: 240 seconds]
kilimanjaro has quit [Ping timeout: 240 seconds]
wilfredh has quit [Ping timeout: 246 seconds]
banjiewen has quit [Ping timeout: 256 seconds]
tfb has quit [Ping timeout: 256 seconds]
Balooga has quit [Ping timeout: 256 seconds]
hydan has quit [Ping timeout: 256 seconds]
billstclair has quit [Ping timeout: 272 seconds]
mjl has quit [Ping timeout: 272 seconds]
pent has quit [Ping timeout: 272 seconds]
Balooga has joined #lisp
drmeister has quit [Ping timeout: 256 seconds]
asedeno has quit [Ping timeout: 256 seconds]
ullbeking has quit [Ping timeout: 256 seconds]
lukego has quit [Ping timeout: 256 seconds]
p_l has quit [Ping timeout: 256 seconds]
rvirding has quit [Ping timeout: 240 seconds]
kilimanjaro has joined #lisp
mgsk has joined #lisp
mjl has joined #lisp
tfb has joined #lisp
jlpeters has quit [Ping timeout: 240 seconds]
chewbranca has quit [Ping timeout: 240 seconds]
l1x has quit [Ping timeout: 240 seconds]
billstclair has joined #lisp
wilfredh has joined #lisp
banjiewen has joined #lisp
even4void has joined #lisp
jlpeters has joined #lisp
rvirding has joined #lisp
lukego has joined #lisp
asedeno has joined #lisp
p_l has joined #lisp
chewbranca has joined #lisp
pent has joined #lisp
drmeister has joined #lisp
hydan has joined #lisp
l1x has joined #lisp
ullbeking has joined #lisp
even4void has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Cymew has joined #lisp
<parjanya> mornings! what serialis/zation package would you recommend? I tried the "save-object" one mentioned on cliki.net, but it does need some maintenance; I tried hu.dwim.serializer before, but I was hoping for something simpler
<no-defun-allowed> What do you need to serialize?
<pjb> parjanya: it really depends on what data structures you want to serialize.
KDr24 has joined #lisp
<pjb> parjanya: and also, what's the destination of the serialized data. You may have constraints on the format or not.
<pjb> parjanya: there are a lot of libraries that can be used for serialization.
KDr24 has quit [Remote host closed the connection]
<no-defun-allowed> You may get away with just writing your graph to a file with WRITE and reading it back with READ, with *print-circle* and *print-readably* set to T, if you have appropriate PRINT-OBJECT methods.
<pjb> parjanya: for example, my heap package could be used for it. It doesn't really serialize, but it copies a lisp data structure into another lisp data structure, in a specific format, that can be stored in a byte vector that can be transfered or saved.
<parjanya> I just need to serialize objects with plists and such things... it would be nice if it was not binary, but not necessary
KDr24 has joined #lisp
KDr24 has quit [Remote host closed the connection]
<pjb> parjanya: prin1 and read can be enough.
jprajzne has joined #lisp
vivit has quit [Ping timeout: 246 seconds]
* no-defun-allowed talks to the wind; at least to pjb who doesn't read it
<pjb> parjanya: if you have clos objects, you can define a print-object method on your classes, and either output #.(make-instance …) strings, or define a specific reader macro.
<pjb> parjanya: you can see an example of that in gsharp.
KDr24 has joined #lisp
<pjb> parjanya: the advantage of doing that is that you get free cycle processing thru #=/##
<parjanya> pjb: anything I could read about this?
<pjb> I have a clone of gsharp at https://github.com/informatimago/gsharp
<White_Flame> structures also print readably by default, if you're using them. Arrays print their contents, but their various config data isn't included
heisig has joined #lisp
<aeth> structs, of course, can have print-object, too
<White_Flame> yep, anything with a class can
ukari has joined #lisp
<White_Flame> (or at least something close to that)
<aeth> which doesn't include conditions in SBCL iirc
amerlyq has joined #lisp
<parjanya> pjb: tx :) aha, I remember having perused your site quite a lot already
<aeth> someone was complaining about something along the lines of conditions not being truly integrated, at least
<no-defun-allowed> Yes, that is an X13J3 issue noted in the CLHS.
<pjb> parjanya: note the use of a version dispatcher ;-)
grabarz has joined #lisp
<no-defun-allowed> See CLOS-CONDITIONS:INTEGRATE http://www.lispworks.com/documentation/HyperSpec/Issues/iss049_w.htm
<aeth> no-defun-allowed: so will it get resolved in a new version of the standard?
<no-defun-allowed> CLtL3 confirmed
Josh_2 has joined #lisp
<White_Flame> aeth: huh, I define print methods on custom conditions and haven't had any issues with SBCL
<White_Flame> is it the built-in ones that don't work?
william1 has joined #lisp
<pjb> aeth: really, the problem is that it's heavily implementation dependent.
<pjb> aeth: routinely, when you change the implementation of a library function, you can see that you don't detect the same errors.
pmden has joined #lisp
<pjb> when the code changes, it doesn't signal the same conditions.
<parjanya> ohh apparently structs are indeed foolproof enough for me to use : o )
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
KDr24 has quit [Remote host closed the connection]
KDr2 has joined #lisp
HiRE_ has joined #lisp
HiRE has quit [Ping timeout: 256 seconds]
<beach> pjb: The term "CLOS object" is meaningless.
pent has quit [Read error: Connection reset by peer]
pent has joined #lisp
ggole has joined #lisp
william1_ has joined #lisp
<iAmDecim> i like that you all are still active on IRC...all hours. *observing*
<parjanya> still?
datajerk has quit [Ping timeout: 265 seconds]
<iAmDecim> parjanya: a lot of people are going to slack and I hate slack. lol. impersonal...
william1 has quit [Ping timeout: 250 seconds]
<parjanya> after googling... proprietary, written in electron, what’s not to dislike? ; )
<iAmDecim> lol...how much time do you have?
datajerk has joined #lisp
<White_Flame> iAmDecim: there's this thing called timezones...
knicklux has joined #lisp
<iAmDecim> White_Flame: timezones are a hoax...
<iAmDecim> jk...jk.
|Pirx| has joined #lisp
<pjb> beach: ok, then s/CLOS object/standard-object/.
even4void has joined #lisp
<pjb>
<beach> pjb: Right.
<iAmDecim> =O
<no-defun-allowed> minion: tell pjb about Universal Greeting Time
<minion> pjb: look at Universal Greeting Time: It is always morning when a person enters a channel, and late night when they leave. You may want to read http://www.total-knowledge.com/~ilya/mips/ugt.html for further information
<loke> no-defun-allowed: that's a stupid idea. Sorry, but it had to be said.
<no-defun-allowed> If more people are joining than leaving, it is morning, and vice versa for afternoon.
<jdz> So we all start using Beijing time?
<loke> jdz: That's fine by me. That's my timezone already.
<jdz> Immediately regretting my decision to get engaged in an off-topic conversation.
<no-defun-allowed> That would personally benefit me, because Beijing isn't too far from here.
<loke> no-defun-allowed: where are you located?
<no-defun-allowed> Melbourne, Australia
<no-defun-allowed> Or, for a more bespoke standard for #lisp et al, it's morning when beach announces it, afternoon starts 8 hours after that, then night another 8 hours after afternoon.
karlosz has quit [Quit: karlosz]
<loke> no-defun-allowed: I'm OK with that. Beach is very reliable.
even4void has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shangul has joined #lisp
wilfredh has quit [Quit: Connection closed for inactivity]
KDr2 has quit [Remote host closed the connection]
<iAmDecim> =( i've decided there is no morning or night. I almost work 2 full time jobs. There's a sun down and sun up...various moons.....
ljavorsk has joined #lisp
KDr24 has joined #lisp
ebzzry_ has quit [Remote host closed the connection]
_whitelogger has joined #lisp
xkapastel has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
ebzzry_ has joined #lisp
_jrjsmrtn has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 250 seconds]
loli has quit [Read error: Connection reset by peer]
loli has joined #lisp
scymtym has quit [Read error: Connection reset by peer]
amerlyq has quit [Ping timeout: 250 seconds]
shka_ has joined #lisp
Lycurgus has joined #lisp
Ven`` has joined #lisp
flamebeard has quit []
hlavaty has joined #lisp
KDr24 has quit [Remote host closed the connection]
flamebeard has joined #lisp
KDr24 has joined #lisp
sarna has quit [Read error: Connection reset by peer]
<parjanya> what’s tha name of this? implementation selector? #+symbolics
even4void has joined #lisp
<Shinmera> #+ is a reader conditional
<Shinmera> clhs #+
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
iAmDecim has quit [Ping timeout: 250 seconds]
even4void has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dmiles has quit []
amerlyq has joined #lisp
amerlyq has quit [Client Quit]
amerlyq has joined #lisp
dmiles has joined #lisp
davepdotorg has quit [Remote host closed the connection]
davepdotorg has joined #lisp
prince1 has quit [Ping timeout: 256 seconds]
sarna has joined #lisp
scymtym has joined #lisp
libertyprime has joined #lisp
william1_ has quit [Ping timeout: 250 seconds]
william1_ has joined #lisp
davepdotorg has quit [Remote host closed the connection]
davepdotorg has joined #lisp
ebzzry has joined #lisp
ebzzry_ has quit [Remote host closed the connection]
varjag has quit [Remote host closed the connection]
varjag has joined #lisp
bendersteed has joined #lisp
davepdotorg has quit [Ping timeout: 264 seconds]
Lord_of_Life_ has joined #lisp
isBEKaml has joined #lisp
Lord_of_Life has quit [Ping timeout: 246 seconds]
davepdotorg has joined #lisp
davepdotorg has quit [Remote host closed the connection]
davepdotorg has joined #lisp
Lord_of_Life_ is now known as Lord_of_Life
Lycurgus has quit [Remote host closed the connection]
dddddd has joined #lisp
oni-on-ion has quit [Ping timeout: 246 seconds]
davepdotorg has quit [Remote host closed the connection]
davepdotorg has joined #lisp
bitmapper has joined #lisp
ebzzry has quit [Remote host closed the connection]
mrcom has quit [Ping timeout: 265 seconds]
cosimone has joined #lisp
iAmDecim has joined #lisp
KDr24 has quit [Remote host closed the connection]
ebzzry has joined #lisp
KDr24 has joined #lisp
iAmDecim has quit [Ping timeout: 256 seconds]
prince1 has joined #lisp
isBEKaml has quit [Quit: leaving]
Bike has joined #lisp
vanjulio has joined #lisp
prince1 has quit [Ping timeout: 264 seconds]
even4void has joined #lisp
gko_ has joined #lisp
vanjulio has quit [Remote host closed the connection]
igemnace has quit [Quit: WeeChat 2.7.1]
jmercouris has joined #lisp
<jmercouris> is there a way to have a body in a defcfun to do some processing?
<jmercouris> or do I have to wrap it in an ordinary lisp function?
<jmercouris> I'm trying to convert from int in C to t or nil
<jmercouris> I was going to make a function that does that, but I'm just wondering if there is not a way to do it within the defcfun
<Bike> you have to wrap it in an ordinary lisp function.
<jmercouris> OK, thank you
<Bike> this is a fairly common procedure. you can use a defcfun with a lisp name of %foo, and then define the exported foo to call it
shidima` has quit [Read error: Connection reset by peer]
<jmercouris> yeah, that's what I've seen done, and have done
<jmercouris> I was just thinking of a better way
<Bike> good for varargs and reference passing and stuff
even4void has quit [Quit: Textual IRC Client: www.textualapp.com]
grabarz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pjb> jmercouris: you will often write lisp wrappers of C functions, if only to deal with error cases.
Nilby has joined #lisp
<pjb> jmercouris: so you can signal lisp conditions instead of returning status codes.
<jmercouris> right
<Bike> you could define a macro to combine them somehow i guess, but cffi doesn't provide one and i haven't seen such a thing
<jmercouris> I think it could be a little bit enater
<jmercouris> s/enater/neater
mrcom has joined #lisp
<pjb> Of course, you will use macros, to deal with homogeneous APIs.
<Bike> well, give it a shot, and if it's nice maybe cffi could incorporate it
<jmercouris> yeah, I will try at some time
<_death> my preference is to have a low-level package containing the C-based interface and a high-level package containing a Lispy interface.. working with C interfaces directly tends to be suboptimal
<pjb> jmercouris: have a look at: https://github.com/informatimago/lisp/tree/master/clext/pkcs11 for example.
vanjulio has joined #lisp
iAmDecim has joined #lisp
<Nilby> jmercouris: You could also define a type converter, e.g. with defining a method on cffi:translaste-from-foreign
libertyprime has quit [Ping timeout: 264 seconds]
<jmercouris> pjb: right, so kind of like what _death said
<jmercouris> Nilby: 1
<pjb> jmercouris: exactly.
<pjb> Notably, it's nice to have a pure CFFI low-level API to directly call C when needed, but it is an unsafe API, so you need to wrap it to ensure C functions are called in a way that won't crash, and that you can use the high level API safely interactively, even if you don't know how to use it.
iAmDecim has quit [Ping timeout: 250 seconds]
cosimone has quit [Quit: Terminated!]
libertyprime has joined #lisp
trocado has quit [Ping timeout: 264 seconds]
<Xach> beach: does the trucler project have a trucler.asd? trucler-test.asd seems to expect one but I don't see it.
<beach> Oh? How strange.
<beach> Hold on. Let me look...
<beach> There is not a trucler.asd, but there is trucler-reference.asd, trucler-native.asd and trucler-base.asd
ebzzry has quit [Remote host closed the connection]
grabarz has joined #lisp
<Xach> What is trucler-test meant to use, I wonder?
<beach> I see not trucler-test.asd. Only trucler-native-test.asd
Necktwi has quit [Read error: Connection reset by peer]
<beach> It depends on trucler-base and trucler-native.
<Bike> trucler-test.asd is in the master branch on s expressionists
<Bike> are you looking at a different repo maybe?
<Xach> That is the only repo I know of, sorry
<Xach> maybe it is not the right one?
<beach> Ah, sorry, yes I see it.
<beach> It might be obsolete.
<beach> You need to check with heisig. I don't know myself.
<Xach> ok
ebzzry has joined #lisp
<splittist> Would be nice to have non-TeX documentation, too. But lots of things would be nice, and this isn't even in the top 7...
<beach> I have come to the conclusion that no matter what surface syntax is used for the documentation, around 90% of people are dissatisfied with it.
<beach> Mainly because there are so many different choices, and everyone seems to have a different preference.
<beach> This is also why I would like to see a documentation system based on CLOS protocols rather than surface syntax.
<beach> But I think jackdaniel is working on such a thing.
<jackdaniel> I do, as well as dizen of other things though :)
<beach> Yeah, I know.
joels has joined #lisp
<jackdaniel> be vary of eu.turtlewate.london system which will emerge one day :)
<jackdaniel> as Jack London ;)
rumbler31 has quit [Remote host closed the connection]
flamebeard has quit []
ssake has quit [Read error: Connection reset by peer]
ssake has joined #lisp
g0d_shatter has joined #lisp
Necktwi has joined #lisp
<heisig> Xach: Yes, the toplevel test suite of Trucler has some bitrot. Give me 10 minutes...
_whitelogger has quit [Remote host closed the connection]
_whitelogger_ has joined #lisp
eschulte has joined #lisp
<eschulte> _death I ended up folding two functions from that ELF/Capstone patch you sent me into my nascent CFFI Capstone package. Are you okay with me publishing that code as part of this package (I'm planning to release it under an MIT license)?
<eschulte> They're the functions that parse Capstone opcode strings into Sexprs. I inline comments attributing them to _death.
sz0 has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
orivej has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
joels has quit [Ping timeout: 264 seconds]
EvW1 has joined #lisp
ebzzry has joined #lisp
niceplace has quit [Ping timeout: 260 seconds]
stepnem has quit [Ping timeout: 250 seconds]
niceplace has joined #lisp
<_death> eschulte: sure
random-nick has quit [Quit: quit]
clothespin has quit [Quit: Leaving]
prince1 has joined #lisp
random-nick has joined #lisp
Bourne has quit [Ping timeout: 256 seconds]
shidima has joined #lisp
<_death> eschulte: like it says in the commit message, though, it's an "ugly hack" :)... in all likelihood it's incomplete, inefficient, does not work with other architectures, depends on the exact textual output of capstone, etc.
<eschulte> _death: great, thanks. I'll post a link here when I get it up
<shidima> Does any one have a working code excample of how to host a css file with hunchentoot?
<eschulte> Yeah, I'll drop a TODO in next to that code. TODO/FIXME innoculation against judgement
<shidima> I have tried different ways of doing it but I can't seem to get it right
prince1 has quit [Ping timeout: 256 seconds]
<Xach> shidima: i don't have short working code handy to share, but i can tell you that it is no different from serving any other content in general.
<Xach> shidima: are you able to serve, say, html files?
lucasb has joined #lisp
davepdotorg has quit [Remote host closed the connection]
davepdot_ has joined #lisp
stepnem has joined #lisp
KDr24 has quit [Ping timeout: 256 seconds]
oni-on-ion has joined #lisp
<shidima> euh, let me check
Bourne has joined #lisp
jmercouris has quit [Remote host closed the connection]
jmercouris has joined #lisp
pmden has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
cosimone has quit [Quit: Terminated!]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
iAmDecim has joined #lisp
pmden has joined #lisp
<shidima> Hah, got it to work. :)
<jmercouris> yay!
sjl_ has joined #lisp
<shidima> Guess I needed some rubber duck debugging
pmden has quit [Client Quit]
KDr24 has joined #lisp
oni-on-ion has quit [Read error: Connection reset by peer]
oni_on_ion has joined #lisp
pmden has joined #lisp
<flip214> Can I tell CFFI:FOREIGN-ARRAY-TO-LISP to copy only elements 5 to 10 into a new lisp array? Apart from doing CFFI:INC-POINTER?
oni_on_ion has quit [Read error: Connection reset by peer]
oni-on-ion has joined #lisp
<pjb> flip214: you could use the address of the end of the field, and a decrement. So you would be doing a DEC-POINTER instead.
<pjb> flip214: using the address of the end and a decrement was really a smart idea of early computings, this this avoided buffer overflow implicitely (the decrement couldn't be negative!).
<pjb> flip214: basically C is a good low-level language. What's to be thrown away, is the standard library, and almost all libraries written in C.
<pjb> void* good_malloc(int size){ return ((char*)malloc(size))+size; }
<oni-on-ion> =/
<jmercouris> =), turn that frown upside down
<oni-on-ion> C is fine for all the stuff we dont have to write =)
iAmDecim has quit [Ping timeout: 256 seconds]
davepdotorg has joined #lisp
frgo has quit [Ping timeout: 240 seconds]
davepdot_ has quit [Read error: Connection reset by peer]
varjagg has joined #lisp
varjag has quit [Ping timeout: 264 seconds]
Ven`` has joined #lisp
asarch has joined #lisp
KDr24 has quit [Ping timeout: 256 seconds]
EvW1 has quit [Ping timeout: 256 seconds]
KDr24 has joined #lisp
frgo has joined #lisp
dale_ has joined #lisp
dale_ is now known as dale
chip2n has quit [Quit: ZNC 1.7.5 - https://znc.in]
pmden has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
chip2n has joined #lisp
ljavorsk has quit [Ping timeout: 250 seconds]
pmden has joined #lisp
Bourne has quit [Ping timeout: 250 seconds]
ljavorsk has joined #lisp
iAmDecim has joined #lisp
sunwukong has joined #lisp
Bourne has joined #lisp
iAmDecim has quit [Ping timeout: 256 seconds]
Lord_of_Life has quit [Ping timeout: 256 seconds]
ljavorsk has quit [Ping timeout: 250 seconds]
Lord_of_Life has joined #lisp
eschulte has quit [Ping timeout: 240 seconds]
jprajzne has quit [Quit: Leaving.]
bendersteed has quit [Remote host closed the connection]
greaser|q has quit [Quit: HYDRA IRC LOL]
prince1 has joined #lisp
prince1 has quit [Ping timeout: 250 seconds]
davepdotorg has quit [Remote host closed the connection]
Bourne has quit [Ping timeout: 250 seconds]
arbv has quit [Quit: ZNC - https://znc.in]
Bourne has joined #lisp
davepdotorg has joined #lisp
sunwukong has quit [Ping timeout: 264 seconds]
joels has joined #lisp
Cymew has quit [Ping timeout: 256 seconds]
davepdotorg has quit [Remote host closed the connection]
davepdotorg has joined #lisp
hlavaty has quit [Remote host closed the connection]
KDr24 has quit [Remote host closed the connection]
KDr24 has joined #lisp
Nilby has quit [Read error: Connection reset by peer]
zmt00 has joined #lisp
kingcons has quit [Quit: ZNC 1.6.5+deb1+deb9u1 - http://znc.in]
libertyprime has quit [Read error: Connection reset by peer]
Bourne has quit [Ping timeout: 264 seconds]
bendersteed has joined #lisp
slyrus__ has quit [Ping timeout: 256 seconds]
ebzzry has quit [Read error: Connection reset by peer]
iAmDecim has joined #lisp
jmercouris has quit [Remote host closed the connection]
cartwright has quit [Remote host closed the connection]
Lycurgus has joined #lisp
cartwright has joined #lisp
iAmDecim has quit [Ping timeout: 250 seconds]
cosimone has joined #lisp
Bourne has joined #lisp
theBlackDragon has quit [Ping timeout: 264 seconds]
pmden has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
greaser|q has joined #lisp
theBlackDragon has joined #lisp
gko_ has quit [Ping timeout: 264 seconds]
<shidima> Hmm, just finished the weblock/reblock quickstart. It seems like an intersting framework
jebes has joined #lisp
iAmDecim has joined #lisp
shidima has quit [Ping timeout: 250 seconds]
iAmDecim has quit [Ping timeout: 250 seconds]
pmden has joined #lisp
pmden has quit [Client Quit]
gko_ has joined #lisp
davepdot_ has joined #lisp
karlosz has joined #lisp
gareppa has joined #lisp
davepdot_ has quit [Remote host closed the connection]
gareppa has quit [Remote host closed the connection]
davepdot_ has joined #lisp
gko_ has quit [Ping timeout: 256 seconds]
davepdotorg has quit [Ping timeout: 256 seconds]
davepdot_ has quit [Ping timeout: 256 seconds]
Jesin has quit [Quit: Leaving]
ecraven has quit [Quit: bye]
joels has quit [Ping timeout: 250 seconds]
varjagg has left #lisp [#lisp]
karlosz has quit [Quit: karlosz]
Jesin has joined #lisp
karlosz has joined #lisp
g0d_shatter has quit [Quit: Leaving]
prince1 has joined #lisp
afry has joined #lisp
efm has quit [Remote host closed the connection]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
afry has quit [Remote host closed the connection]
efm has joined #lisp
davepdotorg has joined #lisp
prince1 has quit [Ping timeout: 264 seconds]
jcowan has joined #lisp
<jcowan> Is it true that some Lisp objects belong only to class T? Does this happen in practice?
knicklux has quit [Ping timeout: 260 seconds]
davepdotorg has quit [Ping timeout: 246 seconds]
Ven`` has joined #lisp
buffergn0me has joined #lisp
<phoe> jcowan: don't think so
<jcowan> Presumably an implementation could add a new kind of object without a CLOS type, though it seems stupid to do so.
<phoe> at least not in standard Lisp
<jcowan> Sure.
<phoe> also what you said - implementations would prefer to have some sort of class for the objects, if only for segregation purposes
<phoe> usually they're instances of built-in classes, since these are already the most get-your-hands-off-me kind of classes in Lisp
<phoe> for objects that are absolutely the weirdest kinds, e.g. SBCL has SB-KERNEL::RANDOM-CLASS
<Bike> you could phrase this as: an object that's a direct instance of T
<Bike> it would be a silly thing to do but i don't think the standard disallows it
<phoe> I think the same thing
<jackdaniel> (make-instance 't²) ;)
<Bike> clhs t
<Bike> no mention
_leb has joined #lisp
danielboston26 has joined #lisp
<phoe> if you want some implementation-defined fun, (sb-pcl:class-prototype (find-class 't))
<phoe> that's a direct instance of class T
greaser|q has quit [Changing host]
greaser|q has joined #lisp
greaser|q is now known as GreaseMonkey
jprajzne has joined #lisp
knicklux has joined #lisp
eMBee has joined #lisp
arbv has joined #lisp
arbv has quit [Client Quit]
_leb has quit []
efm has quit [Quit: Konversation terminated!]
<aeth> pjb: standard-object doesn't really fit, either, because most of the advice also applies to structure-objects from structure-classes, not just standard-objects from standard-classes, at least iirc.
leb has joined #lisp
Intensity has joined #lisp
Lycurgus has quit [Remote host closed the connection]
<Bike> also jcowan, you said "CLOS type", but just to be clear, a class doesn't need to support anything in CLOS except being dispatchable (i.e. the ability to distinguish members of the class from non members). the built in classes are usually like this.
* jcowan nods.
<aeth> (And it looks like conditions may or may not be standard-objects and are either instances of standard-classes or their own class type)
<aeth> phoe: that's fun. #<unknown pointer object, lowtag=#x3 {1000565F43}>
<aeth> Also (eq (sb-pcl:class-prototype (find-class 't)) (sb-pcl:class-prototype (find-class 't))) => T
<phoe> aeth: does the standard mandate that (find-class 'condition) returns an actual class though?
william1_ has quit [Ping timeout: 256 seconds]
<phoe> the standard seems pretty damn careful to avoid implying anywhere that condition types are actual classes. to me, it implies that a conforming CL implementation can implement conditions without even a system class named CONDITION.
<Bike> clhs 4.3.7
<specbot> Integrating Types and Classes: http://www.lispworks.com/reference/HyperSpec/Body/04_cg.htm
<Bike> Figure 4-8 "Classes that correspond to pre-defined type specifiers" includes the standard condition types.
<phoe> oh! yes, correct.
ecraven has joined #lisp
<phoe> this makes the standard even more bizarre to me
<phoe> CL-defined condition types have classes, but user-defined condition types... aren't required to?
<aeth> I'm guessing the standard is ambiguous about whether condition classes are standard-classes (e.g. ECL) or their own class (e.g. SBCL)
<phoe> No, not really; it could state that condition types are system classes, at which point they can be implemented via built-in classes.
<phoe> ...define-condition has the option :allocation :class though, which is kinda cheeky now that I think of it
<Bike> "The metaclass of the class condition is not specified." in 9.1.1
<Bike> it's dumb, anyway. they should just be classes
<phoe> so much this
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
joels has joined #lisp
<aeth> The whole condition system seems... a bit unusable if you want to write a full, portable application. The larger problem is that you don't know what comes from most internal errors. e.g. (destructuring-bind (x) (list 1 2))
slyrus has joined #lisp
<aeth> And if your macros (if you have any) aren't full of DESTRUCTURING-BINDs, you're probably not writing them properly, since DEFMACRO's fancy lambda list won't help if there's an unspecified number of something from 0 to n, but a D-B gives you essentially the same API.
<aeth> So a macro can't portably have the same error on different implementations.
<Bike> yes, the conditions signaled by standard operators are definitely underspecified. i wouldn't go so far as saying that makes it unusable though. i mean how often do you even want to handle that kind of error?
<aeth> literally every single macro I write if I could?
<aeth> (define-condition macro-syntax-error (error) ...)
<Bike> why? what are you going to do with them?
<aeth> better error messages?
<aeth> D-B will catch most macro syntax errors, but it won't let you tell the user what's wrong.
<phoe> aeth: that's why I hacked around it and wrote my destructuring-bind*
<jcowan> In R6RS Scheme, all conditions are subclasses of the standard class &condition, and vice versa
vlatkoB has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<phoe> jcowan: the last time I checked, same thing goes for all Lisp implementations other than SBCL
<phoe> and even SBCL has condition classes, it's just that they aren't standard-objects
<jcowan> however, since R6RS has no support for multiple inheritance, compound conditions are a separate type that is not a subclass of &condition
<phoe> I checked CCL, ECL, ABCL, CLISP, Clasp, ACL, and LW - (find-class 'condition) is a standard-class
<jcowan> Thanks!
<aeth> Unfortunately, my trivial example works well enough in SBCL that you can figure out what's going on, probably, if you got this error: (defmacro foo (things) `(progn ,@(destructuring-bind (x) things (list x)))) (foo 1 2 3)
<aeth> but it pretty quickly becomes cryptic and contextless
<jcowan> One of the barriers to accepting R6RS was that it imposed a standard condition hierarchy that often contradicted what existing Scheme had (if anything)
william1_ has joined #lisp
iAmDecim has joined #lisp
iAmDecim has quit [Ping timeout: 250 seconds]
cosimone has quit [Quit: Terminated!]
arbv has joined #lisp
arbv has quit [Client Quit]
loli has quit [Ping timeout: 256 seconds]
orivej has quit [Quit: orivej]
arbv has joined #lisp
orivej has joined #lisp
Ven`` has joined #lisp
arbv has quit [Client Quit]
arbv has joined #lisp
loli has joined #lisp
lucasb has quit [Quit: Connection closed for inactivity]
dgtlcmo has joined #lisp
dgtlcmo has quit [Client Quit]
orivej has quit [Read error: Connection reset by peer]
orivej has joined #lisp
joels has quit [Ping timeout: 256 seconds]
niez has joined #lisp
cosimone has joined #lisp
hiroaki has quit [Remote host closed the connection]
ggole has quit [Quit: Leaving]
hiroaki has joined #lisp
shka_ has quit [Quit: Konversation terminated!]
<pjb> jcowan: well, the CL standard carefuly avoided to impose anything to contradict existing implementations at the time (in most cases). I'm not sure it was a wise decision. On one hand, few lisp implementations that existed at that time still exist now. On the other hand, this makes a standard that is way too under-specified. It can be fun for language-lawyers, but it practice it's not helpful.
* jcowan nods
<jcowan> C took the attitude "Code is sacred, implementations are not" and I think that's a good position.
<jcowan> Unfortunately they also took the position "Code with undefined behavior can break at any time", which is a major source of bitrot in C.
prince1 has joined #lisp
davepdotorg has joined #lisp
prince1 has quit [Ping timeout: 246 seconds]
<jcowan> Admittedly some of the definitions of UB are just laziness on the WG's part. For example, running a program that was compiled from a source code file that did not end in a newline is UB.
davepdotorg has quit [Ping timeout: 256 seconds]
vanjulio has quit [Remote host closed the connection]
xkapastel has quit [Quit: Connection closed for inactivity]
<Bike> for the next version they should say programs without a newline at the end have to be parsed and compiled as pascal. just to keep everyone on their toes
<karlosz> fun fact, the fact that sbcl's condition is not a standard-class derives from the fact that ANSI didn't want to disturb spice lisp's condition hierarchy
<karlosz> cmucl didn't integrate clos into its bootstrap process, and that's why it can't be a standard-class. sbcl preserves that quirk to this day
iAmDecim has joined #lisp
<karlosz> i don't think it would be easy to get conditions be standard-classes
jebes has quit [Ping timeout: 246 seconds]
<jackdaniel> talk about favourism :-)
<dlowe> jcowan: I sense great optimization opportunities with that one.
<dlowe> "this whole file can't happen so we can optimize it away"
<jcowan> Oh no, more than that. "This file is no good so we will kill our parent processes up to the login shell."
<karlosz> well, it may not have all been cmu's fault, but certainly they would've had to do some extra work had standard-class been mandated to be the super class of condition
<jcowan> Without an error message, of course
buffergn0me has quit [Ping timeout: 246 seconds]
<jcowan> There are 191 UBs in C99, but probably a great many more in ANSI CL
<jcowan> Oh, here's another win: If an unmatched " or ' appears on a line, UB.
Lord_of_Life has quit [Ping timeout: 250 seconds]
Lord_of_Life has joined #lisp
william1_ has quit [Ping timeout: 264 seconds]
heisig has quit [Ping timeout: 250 seconds]
<Bike> CL has uh, schema? like calling a standard function with arguments that don't fit the types
<oni-on-ion> jcowan, ouch. on the quotes -- is that C99 or ANSI CL ?
<jcowan> C
<oni-on-ion> ah=)
<oni-on-ion> i would be curious to see the UB count for CL; but as for C, a lot of the UB has become Expected B
EvW has joined #lisp
leb has quit []
fivo has joined #lisp
william1_ has joined #lisp
<asarch> (cpuinfo 0)
<semz> doesn't CL tie a fair share of UB to the safety level? would be interesting to see how strongly the amount of UB varies between those
amerlyq has quit [Quit: amerlyq]
<semz> especially considering the old "(safety 0) is worse than C" saying
<no-defun-allowed> "Symbolics CADDR Revision 3" 4.2e9 (:cdr-coding :eight-bit-type-tag :two-bit-gc :spectre :meltdown :avx4)
<oni-on-ion> would be a good task for ml/dl
efm has joined #lisp
<oni-on-ion> wat
<no-defun-allowed> asarch asked for CPU info.
<Bike> safety isn't all. something as simple as (+ nil) is undefined behavior even at safety 3
william1_ has quit [Ping timeout: 250 seconds]
<asarch> Although, more properly, (sb-ext:cpuinfo 0)
EvW has quit [Ping timeout: 272 seconds]
narimiran has quit [Ping timeout: 246 seconds]
<aeth> dlowe: I mean, why isn't that a thing yet? Someone should do that for one of the CL C implementations so it can win on performance benchmarks.
<oni-on-ion> asarch, can't find it =(
<Bike> but, because we are not crazy people, implementations usually define it to be an error instead of going oh this must be unreachable, let us optimize
<asarch> Because there is cpuinfo function
<aeth> semz: (safety 0) is worse than C in SBCL because SBCL stops doing static checking as well as runtime checking when (safety 0) meaning that you can introduce things that SBCL normally would have (and C would have) caught
<asarch> You have to write it using Assembly and call it from Common Lisp using CFFI
<oni-on-ion> asarch, i would believe you, if not for Symbol "CPUINFO" not found in the SB-EXT package.
<oni-on-ion> sighs
<_death> proposal: introduce negative optimize values
<aeth> Does CLHS specify what (+ 1 1) is or can we use our own arithmetic?
<Bike> the CL standard does not define arithmetic, no
<aeth> have #'+ just be bound to RANDOM except (+) which is probably specified to be 0...
<oni-on-ion> (run-program "/bin/cat" '("/proc/cpuinfo"))
<aeth> well, not really bound to RANDOM since the argument count can differ
<oni-on-ion> random* with &rest
lavaflow has quit [Ping timeout: 250 seconds]
karlosz has quit [Quit: karlosz]
lavaflow has joined #lisp
<_death> with (safety -3) an aref with invalid indices causes your screen to strobe, potentially inflicting epileptic seizures
<aeth> oni-on-ion: (defun random* (&rest rest) (random (reduce #'+ rest :initial-value 1)))
<oni-on-ion> asarch, ironically, considering it is x86, the user of this code would already at least know a bunch of their processor already ...
<aeth> oni-on-ion: the best part is that it does in fact sum the value you want if you make the new CL:+ just be RANDOM*
<oni-on-ion> hah
<oni-on-ion> i like it
<aeth> And (random*) is 0 since it's getting a random integer from 0 below 1 (since it starts with the initial value 1).
cosimone has quit [Remote host closed the connection]
<oni-on-ion> yeah =) =)
slyrus_ has joined #lisp
cosimone has joined #lisp
<asarch> Yeah, I know :'-(
<asarch> I wonder how to port that code to the AMD64 platform...
slyrus has quit [Ping timeout: 250 seconds]
<no-defun-allowed> That is some very odd looking Lisp.
<aeth> Slight correction, of course. You'd need to be able to take the absolute value of the input number but store the sign first, and then negate it if it was negative. And if 0 return 0. So it's not as simple as just using random*
<oni-on-ion> i think its xml
<oni-on-ion> aeth, or just doc the UB =)
<Bike> the definition of negation isn't defined either
<Bike> er, strike first three words
<phoe> Is it defined behaviour to unintern keywords?
<semz> Bike: Is (+ nil) UB because the standard doesn't require type checking or am I missing something?
<phoe> semz: in safe code, this is required to signal an error
<Bike> phoe: no, it actually is not.
<semz> It's late so if it was a joke about something it's easily possible I missed it
karlosz has joined #lisp
<phoe> Bike: wait a second, it is not?
<Bike> clhs 1.4.4.3
<specbot> The ``Arguments and Values'' Section of a Dictionary Entry: http://www.lispworks.com/reference/HyperSpec/Body/01_ddc.htm
<Bike> " Except as explicitly specified otherwise, the consequences are undefined if these type restrictions are violated. "
<Bike> the definition of + does not explicitly specify otherwise. it does say "Might signal type-error if some argument is not a number."
<Bike> per clhs 1.4.2, this means that it's undefined behavior, but if an error is signaled that error must be of type type-error.
bitmapper has quit [Remote host closed the connection]
<phoe> yes, correct.
<Bike> "an error should be signaled" is the terminology for when safety matters
<phoe> right - thanks.
<Bike> now, in my opinion, this is dumb
<aeth> Lots of "should"s, not a lot of "must"s. I noticed this the other day.
<phoe> in my opinion that's dumb too
<aeth> I guess portability wasn't a part of the culture like it is now.
<Bike> CAR and CDR and so on have "should signal" and that's fine
<phoe> (+ nil) evaluating to 0 is kinda javascripty for my taste but permitted by the spec
bitmapper has joined #lisp
<Bike> eugh. fuck that.
<aeth> phoe: worse, it permits (+ nil) to be "nil" and (+ 0 nil) to be 0 and (+ nil 0) to be "nil0" :-)
<phoe> (+ '(1 2 3) '(4 5 6)) ;=> (1 2 3 4 5 6)!!!
<phoe> lemme submit a SBCL patch real quick
<aeth> except, of course, you won't know if it's "NIL" or "nil" unless you know what the reader global variables are set to, e.g. *print-case*
<phoe> but
<phoe> Is it defined behaviour to unintern keywords?
<aeth> phoe: on the other hand, it would permit (+ matrix-a matrix-b)
<phoe> aeth: :thonk:
<phoe> tempting, but I'll pass
<aeth> As I've said many times, CL has matrices, it just doesn't define * (or in this case, +) for them.
<_death> you can use word embeddings to have (+ (- 'king 'man) 'woman) ==> queen
<oni-on-ion> phoe, ah, no that (+ '() '()) does not work =) i was going to say...
<phoe> oni-on-ion: it's UB, so you just need to find an implementation that does what you want
<phoe> if something is undefined, an implementation is permitted to define it
<karlosz> you can just shadow cl:+ if you want to do that portably
lavaflow has quit [Ping timeout: 240 seconds]
<aeth> A 2D array is just a matrix...
vaporatorius has joined #lisp
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
<aeth> well, if you want to be technical, as long as it only contains numbers
<aeth> But that can be deferred to evaluation of +, just like mapcar will attempt to run on an improper list and fail at the end
<oni-on-ion> phoe, ah. true - i tried in sbcl. my prefferred behavior would be of course, '(1+4 2+5 3+6)
<oni-on-ion> karlosz, yea=)
<aeth> oni-on-ion: You probably mean `(,(+ 1 4) ...) but it's more amusing if you actually do mean create the symbols e.g. |1+4| :-)
<jcowan> There are 136 instances of "consequences are undefined" in the CLHS, including the definition of the term and instances in issues
<jcowan> So that's roughly comparable to the UBs in C99
<aeth> jcowan: we're just talking about something that is "should" that should be "must", though.
<aeth> So there's more!
<Bike> no, the situation i described does use the phrase
<aeth> ah, oops
<oni-on-ion> aeth, heh. mixing syntaxes like its PC
<jcowan> 744 shoulds, 851 musts, but I don't know if the CLHS was policed to eliminate instances that are not constraints on the implementers
<jcowan> (R7RS was, and a bit of work it took, too)
<aeth> oni-on-ion: I mean, I love mixing syntaxes... I wrote an infix s-expression macro for fun like #I(1 + 1 + 1) => (infix (1 + 1 + 1)) => (+ 1 1 1) => 3
<jcowan> a lot of user-side 'must' had to be rewritten as 'it is an error if'
cosimone has quit [Quit: Terminated!]
* jcowan backscroll
<aeth> oni-on-ion: Also, Gitlab thinks that my .lisp file that I said is Common Lisp specifically in an override file is Scheme because I did such a good job at making the macro look like Scheme syntax :-)
<aeth> It's like, "Yeah, you say that all *.lisp is Common Lisp, but we still are going to mark this as Scheme anyway."
<oni-on-ion> aeth, yep! i made a split objc+smalltalk project long ago. bridging gaps might be my favorite part of IT/CS. there is a name for it ... technical something.
william1_ has joined #lisp
<oni-on-ion> connecting things that ain't previously
<oni-on-ion> ew gitlab should have the same modes for all s-exp =)
<oni-on-ion> any other highlighting is not that useful for lisp. but i use .cl for CL
<aeth> oni-on-ion: amusingly, the syntax highlighting is incredibly different
<phoe> lemme ask yet again
<phoe> Is it defined behaviour to unintern stuff from the KEYWORD package?
<aeth> oni-on-ion: This isn't the only time I'm going to be writing both languages side by side, and wow it's inconsistent. https://gitlab.com/mbabich/airship-scheme/-/blob/8594a76b78f49d0f908268257e10fc0dd86c85d1/CONTRIBUTING.md#example
* phoe goes to sleep
ukari has quit [Remote host closed the connection]
<aeth> (Markdown uses the same highlighting as the source file pages)
ukari has joined #lisp
<Bike> i don't see anything about uninterning keywords in the standard
<oni-on-ion> aeth, ahh, yes i see. definately suggest special ext for airship =)
<aeth> Also amusingly, the syntax highlighting of standard-procedures.lisp is correctly Common Lisp even though it's clearly marking the file as Scheme in its language detection because that's the only way they could possibly get it to 89.8% Scheme 10.2% CL
<no-defun-allowed> Neither do I.
<oni-on-ion> aeth, is this somethihg that gitlab staff should be made aware of ?
<jcowan> I think the language marking is best-effort only
nckx has quit [Ping timeout: 264 seconds]
nckx has joined #lisp
<jcowan> See https://en.wikipedia.org/wiki/Polyglot_(computing) for some programs that are simultaneously in several different languages, doing the same or different things
<aeth> jcowan: it's just some really bad regex, like... if .lisp it's Common Lisp except if it has "define" in which case it's "Interlisp" (or some other niche Lisp)
william1_ has quit [Ping timeout: 250 seconds]
<aeth> except it probably just uses it as a heuristic, so if you have a bunch of DEFUNs you're mostly fine, until you write a file that doesn't have any DEFUNs and just has a bunch of DEFINE-CONDITIONs
<jcowan> phoe: I don't see any reason why (unintern :foo) is invalid
gravicappa has quit [Ping timeout: 250 seconds]
<phoe> that sorta makes it troublesome because then I can do stuff like (unintern :allow-other-keys :keyword) and who knows how it is going to work
<phoe> since AFAIR there is no list of keywords defined to be untouchable
<jcowan> both clisp and sbcl refuse to do it and return nil
<jcowan> afaik keywords have no special meaning in functions that aren't defined by keyword lambdas, so (unintern :foo) means just what it appears to mean.
<jcowan> you don't need :allow-other-keywords
<jcowan> Digression: which optimization qualities are actually useful and used?
<Bike> other than compilation-speed i think implemetnations use all of them
<phoe> my SBCL actually performs that
<phoe> jcowan: (unintern :foo) returns nil because :foo is not imported into your *package*
<phoe> you need to explicitly specify the package
<jcowan> sorry for the brain fart, I forgot that keywords are not (normally) present in any package except the keyword package
<Bike> sbcl does seem to use compilation-speed in a couple places
<aeth> :foo is just 'keyword:foo iirc
<oni-on-ion> my opinion is that keywords add little usefulness to CL
<aeth> oni-on-ion: You need keywords if you want to write macros without having to do what LOOP does (however it does it) with the symbols
<oni-on-ion> no one uses regular symbols. may as well make symbols into keywords so we dont have to use the awful :syntax
<aeth> (Or without exporting a dozen symbols that don't do anything)\
<phoe> also this leads to obvious pathologies on SBCL such as https://plaster.tymoon.eu/view/1712#1712
<oni-on-ion> aeth, does hygiene help that ?
<aeth> oni-on-ion: I think :syntax and syntax: should be interchangable and both mean keyword, although I understand why CL did it the way it did, which makes :foo just implicitly insert 'keyword in front
<Bike> what? why would "syntax:" mean that?
<aeth> Because if :foo and foo: were both synonymous with 'keyword:foo then you could do this (foobar key: :value) and it would be clearer
<oni-on-ion> aeth, i agree 1000000000% and i hope to see that in airship !
<Bike> but then : doesn't separate package and symbo.
<aeth> Right now you need to do (foobar :key :value) and it's a mess with multiple keys unless you have each pair on its own line as a convention
<jcowan> Keywords are not (yet) standardized in Scheme, but various implementations accept some of (:foo foo: #:foo)
<aeth> (foobar key1: :value1 key2: :value2) makes more sense in one liners
<oni-on-ion> (open window: w title: "asdasd") its more english, too. as lisp is already the closest horizontal signal as prose
<oni-on-ion> aeth, very much agree. did not see that side of it too.
<jcowan> or none of the above, of course
<oni-on-ion> jcowan, yep !! guile, chicken, chez =)
<aeth> Bike: Yes, it makes it a bit less elegant of a language design in exchange for more readable one liners for keyword-argument functions
<Bike> doesn't seem any mroe readable to me
<jcowan> "In all lands custom is king."
<phoe> { "key": "value" }
<Bike> it's not like the values are always going to be keyword symbols, or even usual
<jcowan> https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/KeywordSyntax.md gives the nitty-gritty on what Schemes accept what.
<phoe> or { key: value } if we're in JS
<jcowan> The foo: syntax comes from DSSSL
<aeth> Bike: consider (foobar :a :b :c :d :e :f :g :h) vs. (foobar a: :b c: :d e: :f g: :h)
<aeth> a bit ugly, but it doesn't look as bad when they're not single letters
<Bike> i read that as a, b c, d e, f g, h
<oni-on-ion> prefixcolon is the main reason i am not fully invested in CL. two reasons for this. in objective-c and smalltalk, colons are after the name of arguments. secondly, hebrew goes right to left -- and uses the colon for sentence seperators like english period '.' --- so ":key" is... dyslexic at best.
aindilis has quit [Read error: Connection reset by peer]
<aeth> and ime the really complicated functions/macros/etc. that take in keyword arguments are also very likely to have keyword values for those keyword arguments, too, which makes things a massive mess unless you use multiple lines as a convention
<Bike> actually no, i'm not going to argue syntax, what am i doing
<oni-on-ion> jcowan, openstep property lists. i think.
Bike has left #lisp [#lisp]
<jcowan> I am messing about with a function that if done with keywords would allow 28 keyword arguments
<jcowan> I think it's going to accept an alist instead.
<jcowan> or a plis
<jcowan> t
<oni-on-ion> x_x
EvW1 has joined #lisp
<jcowan> One irritating thing about alists and plists is that () is an instance of either, so you don't know what to do if you want to insert a key and value into ()
<jcowan> should it return (key value) or ((key . value))?
<oni-on-ion> UB!
sjl_ has quit [Ping timeout: 250 seconds]
* jcowan laughs
<jcowan> Not this time
<jcowan> Of course plists are mutated when possible, alists are not
<phoe> jcowan: such functions exist
* phoe quickloads drakma
<aeth> jcowan: which is why any use of plists or alists should in fact actually be a plist or alist tail with an identifier as the first element, which I am actually going to enforce in my .sxp file format.
<jcowan> I think a random special value like (list '@) is a better choice, as it does not break assoc etc.
<aeth> well, you pass in cdr to functions like assoc
<phoe> ;; any alist with an even number of cells is actually a plist, too
<aeth> cdr is cheap
<aeth> cons is, too, so tagging it is also cheap
<jcowan> aeth: true phoe say what?
prince1 has joined #lisp
<aeth> jcowan: ((key . key) (value . value))
<phoe> jcowan: ((a . 1) (b . 2)) is a plist containing one pair, where the key is (a . 1) and the value is (b . 2)
<phoe> thanks for attending my ted talk
* phoe goes to sleep for real now
<aeth> phoe: plagiarism :-p
rumbler31 has joined #lisp
cosimone has joined #lisp
aindilis has joined #lisp
<jcowan> I don't think plist indicators can be pairs: the definition of property indicator refers to name, which (absent special context) is an identifier
<jcowan> It took me some time to make sure of that
prince1 has quit [Ping timeout: 240 seconds]
davepdotorg has joined #lisp
prince1 has joined #lisp
<phoe> property list n. 1. a list containing an even number of elements that are alternating names (sometimes called indicators or keys) and values (sometimes called properties). When there is more than one name and value pair with the identical name in a property list, the first such pair determines the property.
knicklux has quit [Ping timeout: 246 seconds]
rumbler31 has quit [Ping timeout: 256 seconds]
davepdotorg has quit [Ping timeout: 246 seconds]
msk has quit [Remote host closed the connection]
msk has joined #lisp
aindilis has quit [Remote host closed the connection]
smazga has joined #lisp
aindilis has joined #lisp
<_death> phoe: the glossary definition may not state it explicitly, but the names are intended to be symbols.. in particular, GETF is one of the few CL functions that uses EQ for comparison (so numbers/characters make for really bad property indicators...) .. the same goes for catch tags by the way
sarna has quit [Ping timeout: 246 seconds]
jebes has joined #lisp
fivo has quit [Quit: WeeChat 1.9.1]
<jcowan> Exactly. And name n., v.t. 1. n. an identifier by which an object, a binding, or an exit point is referred to by association using a binding. 2. v.t. to give a name to. 3. n. (of an object having a name component) the object which is that component. ``The string which is a symbol's name is returned by symbol-name.'' 4. n. (of a pathname) a. the name component, returned by pathname-name. b. the entire namestring, returned
<jcowan> by namestring. 5. n. (of a character) a string that names the character and that has length greater than one. (All non-graphic characters are required to have names unless they have some implementation-defined attribute which is not null. Whether or not other characters have names is implementation-dependent.)
<jcowan> definition 1 is the relevant one, because 2 is a verb, 3 is about name components, 4 about pathnames and 5 about characters. A cons is not a name.
<jcowan> identifier n. 1. a symbol used to identify or to distinguish names. 2. a string used the same way.
<aeth> heh, I guess jcowan knows about language standards
<jcowan> so I guess a property indicator can be a string technically, but then getf will not be able to find it unless very special precautions are taken to make sure that the key on the plist and the key being getfed are eq.
<jcowan> getf'ed
slyrus__ has joined #lisp
random-nick has quit [Ping timeout: 250 seconds]
slyrus_ has quit [Ping timeout: 264 seconds]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven`` has joined #lisp
Ven`` has quit [Client Quit]
slyrus_ has joined #lisp
slyrus__ has quit [Ping timeout: 250 seconds]
rumbler31 has joined #lisp
<jcowan> So yes, in order to be useful a property indicator must be a symbol
jebes has quit [Remote host closed the connection]
slyrus__ has joined #lisp
slyrus_ has quit [Ping timeout: 256 seconds]
hiroaki has quit [Ping timeout: 264 seconds]
Breaker has joined #lisp
Breaker has quit [Remote host closed the connection]
<iAmDecim> is it bad that i'm happy to now be quarantined...? my job is shutting down for a few weeks. I have a few books i've wanted to deep dive in to.
cyraxjoe has quit [Ping timeout: 246 seconds]
MightyJoe has joined #lisp
<no-defun-allowed> Not at all.
torbo has joined #lisp