freenode/#lisp - IRC Chatlog
Search
22:37:59
quotation
pjb: I'm entirely for deprecating the entirety of the english language if not wholly extending it further into a "special" dialect accompanying the flavors of homoiconicity
22:50:00
slark
when i pass a variable to the macro it fails, but it works with a number can't really understand why it works
22:51:08
slark
Bike: well i know the macro def should be (list 'setq var (list '- var amount))) but well was just trying to mess a bit
22:51:48
Bike
and it sets var (not the symbol passed to the macro, var, every time) to (+ var amount)
22:58:48
pjb
Since this variable has not been declared (in the compilation environment) the actual behavior is actually implementation dependent.
23:00:15
slark
well in fact was thinking why should i return an expression to inc a variable when the inc could be done at expansion time
23:01:09
pjb
Because expansion time is normally done at compilation time, long before the values of the arguments are known.
10:20:06
phoe
|3b|: he wants efficience, I think destructive splitting of conses is going to be as efficient as he can get it
10:21:08
phoe
if you want programmer effiicience, alternatingly push into two lists, then nreverse them
10:21:39
|3b|
(loop for (a b) on (sort ...) by #'cddr collect a into as when b collect b into bs finally (return (list as bs)))
10:21:45
axion
Doesn't have to be 'fastest possible' but this will occur with every page load, so milliseconds count.
10:23:10
|3b|
even then, cache when they change rather than on access might win unless they changee more than they are read
10:23:11
jackdaniel
because it doesn't cons unnecessarily, doesn't reverse and keeps pointer to the list end
10:23:58
jackdaniel
oh, sorry, uiop:while-collecting does a lot of things, I'd go with cmuutil collect macro after all
10:24:22
|3b|
ACTION also notes that the performance loss from non-destructive split probably wouldn't show up on that page load anyway :p
10:25:52
phoe
my algorithm: grab references to 1st and 2nd cons of the list. set the CDR of the first cons to the 3rd cons, set the CDR of the first cons to the CDDDR of the first cons, set the CDR of the second cons to the CDDDR of the second cons. Use the CDRs of the first and second cons as the new values for the first and second cons, loop until the CDRs of the lists are NIL.
10:26:50
axion
The simplest code can be continually made 'fastest possible' over a lifetime for a programmer. I should have known better to phrase that a bit better