Search
Friday, 21st of April 2017, 22:47:42 UTC
22:58:15
Bike
i had no idea github had that interface
23:07:50
azzamsa
thank you so much for this, Sir Froggey
23:07:50
azzamsa
https://github.com/froggey/Mezzano
23:56:07
gigamonkey
Is there somewhere that explains SBCL's disassemble output?
23:56:15
gigamonkey
Quick googling hasn't turned anything up.
23:56:44
gigamonkey
In particular, what is the second column?
23:57:17
jsnell
the raw bytes of the instruction
23:57:23
gigamonkey
Oh, just guessed that. ;-)
3:47:05
aeth
Is there something that is like mapcar or loop ... collect that doesn't add NILs to the resulting list?
3:48:32
aeth
i.e. a combination of (remove nil (mapcar ...)) which seems to be very common
3:49:24
Bike
(loop for thing in list when (process thing) collect it)
4:28:35
beach
Good morning everyone!
8:34:59
Grue`
aeth: yeah it's called MAPCAN: (mapcan #'(lambda (x) (and (numberp x) (list x))) '(a 1 b c 3 4 d 5)) => (1 3 4 5)
8:47:10
shaftoe
if my function's argument is a list containing one specific type... is there a way to help compiler beyond (declare (type list x))
8:47:53
Xof
if you're working with lists, the memory accesses... yes
8:48:34
Xof
if you know the length of the list you could (declare (type (cons integer (cons integer (cons integer (cons ... null)))) x)) but that's really a terrible idea
8:49:05
Xof
you could wrap (the integer ...) around accesses to the list
8:49:48
shaftoe
i have plenty of functions that take lists as arguments, but i've always wondered how to optimize them further
8:49:50
Xof
still not a great idea. Switching representations to specialized vectors is best
8:49:54
shaftoe
usually its list of same type of object
8:50:01
Xof
shaftoe: are they anywhere near any kind of bottleneck?
8:50:12
shaftoe
Xof: premature optimization... :)
8:50:38
pjb
shaftoe: (defun f (l) (loop for i integer in l sum i))
8:50:48
shaftoe
it's not a bottleneck
8:50:59
pjb
shaftoe: ie. use THE around the elements of the list.
8:51:28
pjb
notice that there's no optimization to be have, by declaring the type of all the elements of a list, since cons cells are the same for any type of element.
8:51:47
pjb
(the integer (car list)) ..
Saturday, 22nd of April 2017, 10:47:42 UTC