freenode/#sbcl - IRC Chatlog
Search
10:37:42
flip214
is it possible to tell SBCL save-lisp-and-die to use a different dynamic-space-size in the created executable?
14:46:35
flip214
doing (make-array size :element-type 'type :initial-contents (mapcar #'constructor (iota size))) tells me "The default initial element 0 is not a TYPE" which, while technically correct, shouldn't matter here...
14:54:30
Bike
i've seen that before, but i'm not sure where it comes from. transform-make-array-vector only has that warning in a condition that i don't think is reached if initial-contents is specified.
14:59:13
stassats
happens for (make-array (list y y) :element-type 'list :initial-contents x), but not for (make-array (+ y y) :element-type 'list :initial-contents x)
15:02:13
flip214
doing a one-dimensional array, and then creating a two-dimensional that's displaced from the former does work, so I did that instead
15:07:58
Bike
well, contorting your program to get around a wrong style-warning is definitely not how to go
15:09:43
Bike
in this particular case the warning is improperly issued. the fact the initial element is not of the correct type does not matter because the initial element is not used, as you said
15:10:10
flip214
and creating a nested list for :initial-contents doesn't look that nice either - but a flat list is wrong according to CLHS
15:11:16
flip214
Bike: reading the CLHS I don't think that the warning is improper. my MAPCAR will return a list of objects, but that won't match a 2-dimensional array
15:12:57
flip214
that's quite some longer (both as text and as code) than the displaced array (and wouldn't generalize to more dimensions that easily)... why would it be better?
15:13:26
Bike
flip214: if your initial-contents is wrong than the make-array should signal an error (or compile time warning) about that. it's a separate question from the initial-value.
15:17:43
stassats
so, you just don't care about time complexity, space complexity and garbage collector pressure?
15:20:14
flip214
stassats: is that about the displaced-array? if so, is performance really that bad? creating an additional list and an additional array-descriptor which can immediately be GCed?
15:21:53
flip214
the style-warning that confused me a bit was right (in my case) after all, so I changed the code to be correct.