asen has quit [Read error: Connection reset by peer]
asen has joined #commonlisp
asen has quit [Client Quit]
peterhil has quit [Remote host closed the connection]
taiju has quit [Ping timeout: 245 seconds]
rgherdt has quit [Ping timeout: 245 seconds]
taiju has joined #commonlisp
peterhil has joined #commonlisp
random-nick has quit [Ping timeout: 260 seconds]
rgherdt has joined #commonlisp
taiju has quit [Ping timeout: 260 seconds]
peterhil has quit [Remote host closed the connection]
peterhil has joined #commonlisp
peterhil has quit [Remote host closed the connection]
peterhil has joined #commonlisp
<lagash>
I think I recall ultralisp used it..
Devon has joined #commonlisp
rgherdt has quit [Ping timeout: 245 seconds]
antonv has joined #commonlisp
<antonv>
Hi
srhm has joined #commonlisp
<antonv>
How do you think, when accessing a CLOS object fields from multiple threads, is it necessary to synchronize on the object?
<antonv>
sorry
<antonv>
I mean, the application logic does not require synchronization.
<antonv>
But can a CLOS object be broken somehow if a field is set from one thread and another field is set from another thread
<hayley>
I don't believe so, but like most tricky parts of concurrency, don't count on it.
<hayley>
To my knowledge, Bike's draft for concurrency in WSCL specifies that you can have data races on slots, but the only action that can completely "break" an object is CHANGE-CLASS.
<antonv>
what is WSCL?
peterhil has quit [Remote host closed the connection]
antonv has quit [Ping timeout: 256 seconds]
<hayley>
Well Specified Common Lisp. I wonder if the bot knows about it...
<hayley>
minion: tell antonv about WSCL
<minion>
antonv: WSCL: Well-Specified Common Lisp. Pronounce it as "whistle". A project to revise the Common Lisp standard in a non-controversial way. See https://github.com/s-expressionists/wscl
gigamonkey has quit [Remote host closed the connection]
gigamonkey has joined #commonlisp
gigamonkey has quit [Ping timeout: 256 seconds]
gigamonkey has joined #commonlisp
gigamonkey has quit [Ping timeout: 245 seconds]
Alfr has joined #commonlisp
gigamonkey has joined #commonlisp
<beach>
Good morning everyone!
<hayley>
I should mention that no implementation of Common Lisp actually implements that concurrency specification, but I think that "NN.1.2 Conflicts and Data Races" describes what you can do without racing.
philb2 has joined #commonlisp
Devon has quit [Ping timeout: 264 seconds]
philb2 has quit [Read error: Connection reset by peer]
philb2 has joined #commonlisp
philb2 has quit [Read error: Connection reset by peer]
philb2 has joined #commonlisp
philb2 has quit [Read error: Connection reset by peer]
philb2 has joined #commonlisp
philb2 has quit [Read error: Connection reset by peer]
tyson2 has quit [Remote host closed the connection]
semz has quit [Ping timeout: 268 seconds]
igemnace has quit [Remote host closed the connection]
semz has joined #commonlisp
aartaka has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
s-liao has quit [Quit: Client closed]
nature has quit [Ping timeout: 264 seconds]
akoana has left #commonlisp [#commonlisp]
thomaslewis has left #commonlisp [#commonlisp]
Volt has joined #commonlisp
peterhil_ has quit [Remote host closed the connection]
Jing has quit [Remote host closed the connection]
Jing has joined #commonlisp
thomaslewis has joined #commonlisp
peterhil_ has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
VincentVega has joined #commonlisp
gigamonkey has quit [Ping timeout: 264 seconds]
s-liao has joined #commonlisp
gigamonkey has joined #commonlisp
gigamonkey has quit [Remote host closed the connection]
gaqwas has joined #commonlisp
shka has joined #commonlisp
attila_lendvai has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
Inline has joined #commonlisp
Inline has quit [Remote host closed the connection]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
Inline has joined #commonlisp
pve has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
ym has joined #commonlisp
s-liao has quit [Quit: Client closed]
amk has quit [Ping timeout: 264 seconds]
amk has joined #commonlisp
karlosz has joined #commonlisp
rain3 has joined #commonlisp
phantomics has quit [Quit: Ex-Chat]
karlosz has quit [Quit: karlosz]
Oladon has quit [Quit: Leaving.]
rgherdt has joined #commonlisp
Inline has quit [Quit: Leaving]
s-liao has joined #commonlisp
s-liao has quit [Client Quit]
s-liao has joined #commonlisp
Devon has joined #commonlisp
VincentVega has quit [Read error: Connection reset by peer]
Inline has joined #commonlisp
Krystof has joined #commonlisp
lisp123_win has joined #commonlisp
<lisp123_win>
Does anybody have a list of all the namespaces and their associated functions (e.g. (fdefinition symbol)) for symbols? E.g. classes have names, slots have names, macros have names, the list goes on
<beach>
I don't have a complete list, but if you are collecting one, I can give you more entries. Also, there are namespaces without any accessors, like for types.
<beach>
And FDEFINITION is not for symbols, its for global functions. They can also have names like (SETF <symbol>).
<beach>
A namespace that has an accessor only in the MOP is the one for method combinations.
<beach>
Slots don't have a namespace like that. They just have a name associated with each instance.
Volt has quit [Quit: ]
<lisp123_win>
Thanks Beach
<beach>
Sure.
<lisp123_win>
I will collate something and share back with some notes against them, like what you have above
s-liao has quit [Quit: Client closed]
s-liao has joined #commonlisp
<beach>
There is one for compiler macros, and the accessor is COMPILER-MACRO-FUNCTION.
<beach>
I suppose there is one for condition types that doesn't have an accessor unless the implementation uses classes for condition types. But perhaps every implementation does use classes.
<lisp123_win>
I see - thanks
<Nilby>
I thought there was a namespace diagram, but I guess I was thinking of this: ttps://sellout.github.io/2012/03/03/common-lisp-type-hierarchy
<shka>
ok, i will do that then, but perhaps next week
Lycurgus has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
lisp123_win has left #commonlisp [ERC (IRC client for Emacs 26.3)]
Lycurgus has quit [Quit: Exeunt]
s-liao has joined #commonlisp
azimut_ has joined #commonlisp
VincentVega has joined #commonlisp
azimut has quit [Ping timeout: 276 seconds]
Nselm has joined #commonlisp
lisp123w has joined #commonlisp
<lisp123w>
beach: With Eclector, is there a way to get the top-level form number of a definition (e.g. the third form in the file was the defintion for ordinary function MY-FN)? I am assuming not
<beach>
No, that's not the purpose of Eclector. It just reads. You need to do the rest yourself.
<lisp123w>
That's what I thought. Thanks
Everything has joined #commonlisp
<yitzi>
lisp123w: I use the source tracking of Eclector with a custom client to do that in common-lisp-jupyter. If understand your request.
<lisp123w>
yitzi: Yes, I do that as well (using SBCL). Wanted to make it more portable
<lisp123w>
SBCL returns the top-level form number when you introspect the symbol
<yitzi>
I dont use SBCL internals, just Eclector since I need it to work for CMUCL inspection also.
<lisp123w>
Oh nice. Could I re-use your code :)? Do you just read each line and determine whether its a function definition, macro definition etc.?
gaqwas has quit [Remote host closed the connection]
<Colleen>
contrapunctus: Got it. I'll let Josh_2 know as soon as possible.
tyson2 has quit [Remote host closed the connection]
rain3 has quit [Ping timeout: 265 seconds]
<phantomics>
Guest7426: are you asking for a function that would give #(1 3 6) in return for #(0 1 0 1 0 0 1)?
nature has quit [Read error: Connection reset by peer]
<Guest7426>
sure, doesn't need to return an array though.
<Guest7426>
though for this use case I think I should probably just write something that short circuits as soon as it finds more than one element, since for this case I only need to know when there's 1 or less elements.
<Guest7426>
and then probably just use position.
<Guest7426>
though I'm not even sure if any implementation has given any love to performance for bit arrays.
<phantomics>
You can do this with the April library: (april-c "{⎕IO←0 ⋄ ⍸⍵}" #(0 1 0 1 0 0 1)) → #(1 3 6)
<Guest7426>
like i said, that's all gobbledygook to me with characters I can't type.
<phantomics>
Oh, you're the guy from yesterday, well that code snippet you can just paste in, it returns the indices of elements equal to 1
<shka>
Guest7426: sbcl bit arrays are pretty good
<shka>
BUT you should declare types
theothornhill has joined #commonlisp
<Guest7426>
shka: that's the plan once this basic refactoring is done. Be interesting to see what the difference will be.
<shka>
you can check assembly code to make sure it does what you want
<Guest7426>
phantomics: I'm not going to add another dependency for something that just requires looping over an array and collecting indices.
<phantomics>
Then you could just do (let ((indices)) (loop :for i :across #(0 1 0 1 0 0 1) :for ix :from 0 :when (= 1 i) :do (push ix indices)) (reverse indices))
<Guest7426>
sigh
<Guest7426>
bike: that's interesting. Should be better than integers since I'll be going past most-positive-fixnum
<Bike>
phantomics: i think guest just wants a count, not the positions. i'm sure that's even shorter in apl, of course
<phantomics>
He said that (reduce #'+ ...) wouldn't work,he wanted to know which were set
gaqwas has quit [Remote host closed the connection]
gaqwas has joined #commonlisp
<jackdaniel>
shka: that depends on the speed of your implementation/ machine :-)
<Bike>
oh. hm. well, which do you want, guest? a list of positions is going to more expensive since it involves consing.
<shka>
jackdaniel: oh, this is a fast computer i would say
<shka>
rather beefy CPU
<Guest7426>
if there was a built in function I'd use it and remember for next time. For this use case I just need to know if there is 1 or less.
<phantomics>
So if just one is set, you want to know its position, otherwise return nil?
<shka>
well, there is FIND
<shka>
or POSITION
<shka>
which both would do the trick in this case
aartaka has quit [Ping timeout: 256 seconds]
<Guest7426>
which will both work if there is more than one bit set.
<phantomics>
This will return the position of the only 1 value or nil if there are more than 1
<Guest7426>
i do not need you to write code for me.
<jackdaniel>
shka: then the overhead of these few instructions may be very close to
<jackdaniel>
0
<shka>
well, that's great
<phantomics>
Not sure what you're asking for then, there's no inbuilt function I know of to get the first 1 index iff there's only one of them
<shka>
well, there is position which will sort of do that, but without checking if there is one or more
<shka>
Guest7426 said he wants to shortcircut some logic, and i think that simply calling POSITION or FIND is exactly what he wants in this case
<Bike>
those should both be computable efficiently on the machine. the position through count leading zeroes and the count through logcount. i would just do count and then position.
<White_Flame>
phantomics: since you're inside loop, juse do WHEN blah COLLECT IX, instead of push
cjb has joined #commonlisp
<White_Flame>
(esp for the first example)
<phantomics>
Right, the second is kind of hackneyed with that approach, have to assign the result anyway to apply the rest of the logic
aartaka has joined #commonlisp
frgo has quit []
pve has quit [Quit: leaving]
<phantomics>
A question: my project has some tests that depend on float handling that happens differently in different CL implementations. In ABCL and Lispworks I might get 1.999999 from something that gives 2.0 in SBCL and CCL
lotuseater has quit [Read error: Connection reset by peer]
<phantomics>
Does it make sense to mark a few tests that will run only in SBCL and other CLs whose floats work the same?
<phantomics>
Otherwise I don't know if it'll be possible to get full test coverage in every impl, unless I try rebuilding the float operation primitives and that's a whole other can of worms
attila_lendvai has quit [Ping timeout: 260 seconds]
<shka>
phantomics: it makes more sense to use epsilon IMHO
<shka>
but i am not sure about this one
<shka>
thing is, it is possible to swich reader to read in double-floats by default
<phantomics>
Like check if it's within the range of X+/- epsilon?
<shka>
yup, that's my gut feeling
<phantomics>
Most of the differences are greater than the epsilon, unfortunately
<shka>
but I am not 100% sure if this is the right choice
<shka>
ok, then
<phantomics>
All my tests are done in double floats already
<shka>
wanted to ask about that
<Bike>
you get different results? really? i can only think they just read/print floats differently
<shka>
yeah, actually good point
<shka>
i would expect double-floats to be the same
<shka>
good night all
<phantomics>
Night shka
<Bike>
i mean there's very little chance they're not using ieee float64 for doubles
<Bike>
binary64, rather
<Bike>
but converting to and from decimal can gget weird
<phantomics>
For instance: #(0.9999999999999998D0 -1.4999999999999998D0) is expected to be #(1.0 -1.5)
<phantomics>
In SBCL, (expt 8.0d0 1/3) gives 2.0d0
<phantomics>
In LW, it gives 1.9999999999999998D0
aartaka has quit [Ping timeout: 260 seconds]
<phantomics>
In these cases, it is within the epsilon, but there was another case of a function inverter that went into an endless loop even with a comparison tolerance much higher than the epsilon
lotuseater has joined #commonlisp
aartaka has joined #commonlisp
theothornhill has quit [Ping timeout: 245 seconds]
<Bike>
what about the actual bits? like, if you do integer-decode-float on the result in both implementations, do you get different results?
<phantomics>
Let's see
<Bike>
or use one of the libraries that gets the bits more directly, of course
<phantomics>
Yes, different
shka has quit [Ping timeout: 265 seconds]
<phantomics>
In SBCL: 4503599627370496 -51 1
<phantomics>
In LW: 9007199254740991 -52 1
<Bike>
Huh!
<Bike>
i guess for expt they could be using different algorithms. I wanna say sbcl uses libc cbrt, but don't quote me on that
<phantomics>
Just checked ECL, CCL and ABCL, they're the same as SBCL
aartaka has quit [Ping timeout: 260 seconds]
<Bike>
oh, or i suppose if the 8.0d0 was read in differently... that seems unlikely, though, it's not a weird fraction
<semz>
no chance, 8 is exactly representable as a float
<semz>
1/3 isn't though, that might be it
<phantomics>
(integer-decode-float (expt 8.0d0 0.333333333333333d0)) is the same in all
* Alfr
throws ternary floats at semz.
* semz
takes the crucifix in hand
<phantomics>
Coercing things to floats doesn't work, (integer-decode-float (expt 8.0d0 (coerce 1/3 'double-float))) has the same discrepancy between LW and others
thomaslewis has joined #commonlisp
ec has joined #commonlisp
theothornhill has joined #commonlisp
<phantomics>
So if I use rationals for accuracy, I end up losing accuracy in this particular case
<Alfr>
semz, no need for that. I haven't run across an implementation utilizing those--yet.
ec has quit [Client Quit]
X-Scale` has joined #commonlisp
X-Scale has quit [Ping timeout: 256 seconds]
theothornhill has quit [Remote host closed the connection]
theothornhill has joined #commonlisp
X-Scale` is now known as X-Scale
<Guest7426>
I wonder why logical operators for integers dont have a - like bit and boole.
random-nick has quit [Read error: Connection reset by peer]
greaser|q is now known as GreaseMonkey
<Bike>
"a -"?
<Guest7426>
logand bit-and
<borodust>
Xach: i'll take a look tmr
<lotuseater>
hm maybe as "log" is the abbreviation for "logical" and not the whole word
<_death>
Guest7426: as is often the case with names, historical.. log* are much older
<Guest7426>
I wonder the reason. I guess because of high level stuff if they're older.
<_death>
logand for example exists in LISP 1.5 (1958)
<_death>
it also had logxor and logor (later changed to logior)
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]
<lotuseater>
and who likes it another way can go ahead and rename it :)
dre has joined #commonlisp
dre has quit [Remote host closed the connection]
Oladon has joined #commonlisp
dre has joined #commonlisp
<Guest7426>
how?
ec has joined #commonlisp
<_death>
you can develop your own language, and to make things confusing, use say "bit-and" instead of "logand"
theothornhill has quit [Ping timeout: 260 seconds]
akoana has joined #commonlisp
lottaquestions has quit [Quit: Konversation terminated!]
<lotuseater>
and?
blihp has joined #commonlisp
<Guest7426>
try and use that with apply
<lotuseater>
i did
makomo has quit [Quit: WeeChat 3.2]
_73 has joined #commonlisp
<_73>
is a function tail recursive if the final expression is an if statement where both brances make a recursive call? For example is the local function `f` in this code tail recursive? http://dpaste.com/69QTXA49F
<Alfr>
_73, yes. But you're in #CL, so the implementation of your choice may or may not overflow the stack running your code.
<Guest7426>
ugh these nested arefs are driving me crazy. I'm trying to push to a list inside a vector of lists inside a vector and it pushes to all the lists.
<_73>
Alfr: What about SBCL?
<Alfr>
_73, in at least one implementation it may also depend on whether the defun is compiled and the optimization qualities chosen. ;)
<lotuseater>
Guest7426: and if you need such patterns more often use symbol-macros
<pjb>
Guest7426: (let ((a (make-array '(3 3)))) (aref a 1 2) #|no more nested aref!|#) #| --> 0 |#
<Guest7426>
lotuseater: obviously the same problem occurs with symbol macros when you do something stupid like i did.
<Guest7426>
pjb: that takes more time when I'm iterating over each indice of the inner array.
<lotuseater>
okay i think it's a process of trying :)
tyson2 has joined #commonlisp
<_death>
Guest7426: maybe it depends on how you're iterating.. I think e.g. sbcl uses an underlying vector so that all the elements (which may be pointers or immediate objects) are contiguous memory, while an array of arrays is unlikely to be so local
<lotuseater>
sometimes i like arr[p] for (aref arr p) especially when SETFing so you can do (setq arr[p] foo)