Re: novice: mapcan use?
- From: Kenny Tilton <ktilton@xxxxxxxxxx>
- Date: Wed, 31 Aug 2005 02:35:23 GMT
Pascal Costanza wrote:
Kenny Tilton wrote:
Pascal Costanza wrote:
It cannot be stressed enough: Don't use the destructive functions as your regular tools, and better forget completely about them in the beginning. They should be used exactly like the non-destructive versions, and only ever for optimizations. There's no other advantage in using them, and you should only optimize those parts of your code that you have measured before so that you know that optimizations actually buys you anything. Everything else is a waste of your (valuable!) development time.
Rubbish. That is a defense of ignorance, and a recipe for newbies writing code so painfully slow they abandon Lisp.
/Always/ use the destructive version if one can get away with it. Understanding when one can get away with it is not so hard, and requires no more than the same understanding one needs anyway to program in Lisp.
Code doesn't get automagically faster by replacing non-destructive functions with destructive ones.
Uh, yeah, actually it does. You are simply defending ignorance. In any given situation I can safely use delete or I cannnot. If I can use delete, then using remove conses for no better reason other than to save me from thinking. Or, in the case of newbies, from learning Lisp.
btw, this is not about optimization. Optimization is doing extra work and maybe even obfuscating things a little to get better performance than is possible with straightforward code. There is nothing un-straightforward about destructive functions.
Except I am starting to think /you/ are not sure when destructive functions can be safely used. Hey, good question. Do /you/ follow your own recommended practice of always using non-destructive functions? Is the only time you use delete when you have a performance problem and are trying to fix it?
-- Kenny
Why Lisp? http://lisp.tech.coop/RtL%20Highlight%20Film
"I've wrestled with reality for 35 years, Doctor, and I'm happy to state I finally won out over it."
Elwood P. Dowd, "Harvey", 1950
.
- Follow-Ups:
- Re: novice: mapcan use?
- From: David Steuber
- Re: novice: mapcan use?
- From: Christophe Rhodes
- Re: novice: mapcan use?
- From: Peter Seibel
- Re: novice: mapcan use?
- References:
- novice: mapcan use?
- From: Bernd Schmitt
- Re: novice: mapcan use?
- From: Pascal Costanza
- Re: novice: mapcan use?
- From: Bernd Schmitt
- Re: novice: mapcan use?
- From: Pascal Costanza
- Re: novice: mapcan use?
- From: Kenny Tilton
- Re: novice: mapcan use?
- From: Pascal Costanza
- novice: mapcan use?
- Prev by Date: Re: ASDF: optimization settings and other enhancements
- Next by Date: Re: How to compile/link a multiple files with ECL
- Previous by thread: Re: novice: mapcan use?
- Next by thread: Re: novice: mapcan use?
- Index(es):
Relevant Pages
|