libera/#commonlisp - IRC Chatlog
Search
10:26:11
Shinmera
Pathnames on their own without open/etc are fairly useless, and those you can only implement if you can implement streams, etc.
10:27:46
Shinmera
I have written two libraries to help with wrangling pathnames; pathname-utils and filesystem-utils.
10:34:46
buffet
question about specificity with multiple inheritence: if i have A extends B, and X extends Y, then i make a new class K which extends A, X. does B or Y have higher specificity for K?
10:41:08
jackdaniel
buffet: this describes the algorithm for standard classes: http://www.lispworks.com/documentation/HyperSpec/Body/04_ce.htm
10:43:14
pve
Wow, I was just wondering how the class precedence list is computed, and then a link magically appears :)
10:55:44
buffet
struggling a bit to invoke c2mop:compute-class-precedence-list, i got http://0x0.st/oCII.txt
11:28:08
jackdaniel
it is nice if your implementation provides a method specialized on a symbol but it is not required
11:28:54
jackdaniel
unless you really really insist on the implementation doing the work to compute it /again/
13:46:25
phantomics
Does anyone have an idea what the overhead of (adjust-array) is? I'm using it to reference small bits of a big array, changing the displaced-index-offset to do so, but it's a bit annoying that I have to pass the shape and :displaced-to every time rather than just being able to assign a new offset
13:48:52
phantomics
Ok, I don't change the length though, just the offset but it needs to calculate for the new length each time?
13:49:14
phantomics
How do I do that, afaik (adjust-array) requires you to give the desired shape each time
13:49:19
pjb
No, the length of the displaced array is the size of your window, it's unrelated to the size of the original array. Only it has to fit within.
13:50:23
phantomics
Got it, in my case I'm already storing the window dims and then just referencing them for every (adjust-array) invocation
13:50:52
phantomics
IIRC it also requires that I pass the :displaced-to each time even if it's the same as last time
13:52:02
Bike
adjust-array may not be super optimized, but if you give it an adjustable array it should at least be O(1). it looks like sbcl will inline adjust-array, but the inline body does a lot of checks
13:52:19
pjb
(adjust-array da (length da) :displaced-to (array-displacement da) :displaced-index-offset new-index)
13:52:41
phantomics
I don't know if it could optimize away doing the shape calculation if I'm keeping the same shape every time
13:53:26
pjb
(adjust-array da (array-dimensions da) :displaced-to (array-displacement da) :displaced-index-offset new-index)
13:54:01
phantomics
Could SBCL's compiler recognize the above code and optimize to just change the offset?
13:54:05
pjb
since they're accessors, you can consider the displaced array as an object or structure with the fields containing your pre-computed values.
13:55:39
Bike
it doesn't look like sbcl inlines unless the new dimensions are an integer. you might have to look deeper yeah...
13:57:44
phantomics
I see. Could be worth asking about. The window can't be a vector because the neural net I'm using requires a column as its input - it's a vector with 1 appended to its dims
14:00:49
Bike
i don't know how familiar you are with interpreting these, but the second lambda list with (array integer ...) indicates that this transform is only applied when the second argument is derived to be an integer. which it sounds like will not be the case for you.
14:10:11
pjb
phantomics: if you want to optimize, you could consider changing the order of the indices, so you can displace a vector.
14:12:57
phantomics
Bike: that's correct, I could see about modding the code that accepts it to handle vectors, but that gets into another realm of array stuff
14:14:07
phantomics
I could also render the big source array into a vector of X by 1 column arrays to save compute time, but that would be really wasteful of memory
14:33:52
Bike
phantomics: multidimensional arrays are probably not going to be as optimized as vectors generally. i would represent a column vector as a vector if at all possible.
16:34:44
Shinmera
jackdaniel: CLASS-PRECEDENCE-LIST may fail if the class has not been finalised yet.
16:37:50
jackdaniel
even if so, I'd still call finalize-inheritance and then class-precedence-list (for aesthetics if not anything else) - if the class can't be finalized compute will also fail miserably
16:39:16
Shinmera
in real code, sure. in the context it was originall suggested; just to look at the resulting precedence at the repl; idk.
16:40:31
jackdaniel
that's why I've said "if not aything else [but aesthetics]" ,) I agree that this does not matter (aesthetics aside) when you want to look at the resulting precedence at the repl
16:45:02
jackdaniel
(sufficienly clever implementation would call finalize-inheritance when the slot is unbound)