View Single Post
  #7 (permalink)  
Old 01-28-2012, 07:31 AM
John Cowan
Guest
 
Posts: n/a
Default Re: newbie question, 2

On Jan 28, 2:46*am, Jussi Piitulainen <jpiit...@ling.helsinki.fi>
wrote:
> Fyndhorn Elder writes:
> > One of the pitfalls of scheme and lisp programming:
> > (set! otherlist (append (cons item otherlist))
> > is not
> > (set! otherlist (append (list item) otherlist))

>
> What observable difference do you see? (I assume
> the missing parenthesis is not the point, and
> redundant calls are hardly pitfalls.)


Well, the second example does generate a garbage pair while the first
example does not, though I agree that's not a pitfall unless you are
*very* short on memory.
Reply With Quote