libera/#commonlisp - IRC Chatlog
Search
23:38:15
sm2n
phoe: by accessor logic do you just mean a GF method that calls slot-value and maybe does other things? Or is this some MOP thing?
23:40:06
sm2n
but http://www.lispworks.com/documentation/HyperSpec/Body/m_w_acce.htm says "The consequences are undefined if any accessor-name is not the name of an accessor for the instance."
23:43:27
phoe
(let ((cons (cons 1 2))) (with-accessors ((cons-car car) (cons-cdr cdr)) cons (setf cons-car :foo cons-cdr :bar) cons))
23:45:04
phoe
the way I read it and the way the glossary speaks, in this context an accessor is anything that is capable of performing reads and writes, like CAR or GETF
23:46:46
yottabyte
So are some things in lisp multithreaded by default, like let bindings? That's why they have let*, if you want the bindings evaluated sequentially?
23:46:48
phoe
so, by accessor logic, I mean anything more than performs more logic than just writing some value somewhere - can be typechecks, caching, computation, anything
23:47:40
phoe
global bindings are usually global, and lexical bindings can be shared across threads via closures
23:48:55
phoe
the former implies multiprocessing, the latter simply means that latter bindings in a binding form cannot observe the effects of the former bindings
23:58:34
phoe
for a true multithreaded solution, (ql:quickload :lparallel) and then (lparallel:plet ((x (sleep 1)) (y (sleep 1)) (z (sleep 1))) (list x y z))
0:16:01
Bike
yottabyte: in fact, both LET and LET* mandate that the value forms are evaluated sequentially.
0:30:28
rotateq
yottabyte: You could have read-up about emulating LET* with LET forms in 'On Lisp' by Paul Graham. Even how to emulate LET with LAMBDA. But in CL of those three only LET and LET* are two of the 25 special operators.
8:23:09
mgl
Reading https://sabracrolleton.github.io/testing-framework, I was amazed by the number of testing frameworks, but https://xkcd.com/927/ struck, and now I'm announcing the final word on testing called Try that tries to do almost everything these libraries do while remaining conceptually simple. The design is closest to Stefil's. If you are
8:23:10
mgl
interested, read the tutorial here: https://github.com/melisgl/try#x-28TRY-3A-40TRY-2FTUTORIAL-20MGL-PAX-3ASECTION-29
9:05:50
jackdaniel
the only thing multitude of test frameworks doesn't do is not rewriting the same purpose library over and over again
9:06:48
jackdaniel
if anyone thinks about writing the next one, there are a few name spots open: 3am, 4am, 6am :)
9:15:04
mgl
Deservedly great reception! Have a look though, it may float your boat, especially if you like your tests to be functions.
9:37:59
lisp123
I'm thinking of memoizing function calls for multiple functions. Which is better, to have a giant hash table where I look up the function & its arguments or have individual hash tables for each function?
10:33:49
phoe
minion: memo for lisp123: individual hash tables for functions will be faster and individual caches can be easily removed this way
10:38:26
moon-child
hmm, it occurs to me in a context where you make a more broad and sophisticated cache, you might actually not want to do that. Rather, you would have a more unified architecture where you devote a certain amount of space to cache, and evict based on frequency and expense
10:40:04
phoe
if you want something more advanced then you need techniques for controlling cache size, eviction, etc.. so a simple hash table won't do anymore