Re: Why it does not work?
- From: "Alex Mizrahi" <udodenko@xxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 23 Aug 2009 20:42:09 +0300
KT> It's a shame you spent all that energy thrashing that poor straw man.
Trolling Kenny, isn't it worth it?
??>>>> You can write it in plain English for same effect:
??>>>>
??>>>> (loop for i from 0 :to 10
??>>>> appending (loop for j from 0 to 10
??>>>> collecting (+ i j)))
??>>>>
KT> The inner loop is right there before your eyes forming new unshared
KT> structure. appending is just ignorant.
I thought this is just an example. If you consider it a whole program, it
absolutely
does not matter if it conses or not, since it is done only once. It is
likely that GC
won't be even triggered in this example. Let's check... SBCL says that it
executes
in 0.0 seconds with APPEND and in 0.0 seconds with NCONC. There is no
measurable difference in performance.
Even it is a part of a larger program and this fragment is executed
frequently,
it would make more sense to make it just once. Even if you need a fresh
structure each time, one can implement it as
(copy-list #.(list 'quote (loop ... )))
KT> btw, the real howler there is the justification: so we can write Lisp
in
KT> plain English.
Well, when one learns a language, it is nice when function names are
easy to remember English words, rather than some weird garbage.
Then he can focus on learning language concepts instead of memorizing
bullshit. Later he'll probable notice some pattern -- a lot destructive
functions start with N (I still don't know why) -- and will memorize weird
names too.
KT> You people scare me.
Yeah, you scare me too -- using NCONC instead of APPEND for performance
reasons?
With attitude like this, I wonder why are you Lisp programmer rather than
assembly
language programmer. Well, I guess decades ago it was a big deal...
.
- Follow-Ups:
- Re: Why it does not work?
- From: w_a_x_man
- Re: Why it does not work?
- From: Kenneth Tilton
- Re: Why it does not work?
- References:
- Why it does not work?
- From: Yongwei Xing
- Re: Why it does not work?
- From: Lars Rune Nøstdal
- Re: Why it does not work?
- From: Yongwei Xing
- Re: Why it does not work?
- From: Lars Rune Nøstdal
- Re: Why it does not work?
- From: Yongwei Xing
- Re: Why it does not work?
- From: Alex Mizrahi
- Re: Why it does not work?
- From: Kenneth Tilton
- Re: Why it does not work?
- From: Alex Mizrahi
- Re: Why it does not work?
- From: Kenneth Tilton
- Re: Why it does not work?
- From: Alex Mizrahi
- Re: Why it does not work?
- From: Kenneth Tilton
- Why it does not work?
- Prev by Date: Re: Better mehod to generate a sequence of range?
- Next by Date: Re: Why it does not work?
- Previous by thread: Re: Why it does not work?
- Next by thread: Re: Why it does not work?
- Index(es):
Relevant Pages
|