[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Writing Destructive Functions
- To: firstname.lastname@example.org, email@example.com
- Subject: Re: Writing Destructive Functions
- From: Ranson <ranson@LANNION.cnet.fr>
- Date: 22 Sep 92 07:55:00 GMT
- Cc: firstname.lastname@example.org
- X400-received: by /PRMD=inria/ADMD=atlas/C=FR/; Relayed; 22 Sep 92 07:55:27+0200
- X400-received: by /PRMD=CNET/ADMD=ATLAS/C=FR/; Relayed; 22 Sep 92 07:55:00 GMT
How can you best write destructive functions?
My understanding of the Lisp wisdom is that the best way is to NOT write
destructive functions. Lisp is a functional language: write functions that
return results. You will also note most (all?) of Common Lisp functions work
What you could do is:
1/ Write a destructive function (in the CL meaning: compute the result, maybe
destroying the parameters).
2/ Write a macro that calls the function and SETFs a place to the result.