[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Writing Destructive Functions
- To: info-mcl@cambridge.apple.com
- Subject: Writing Destructive Functions
- From: jbk@world.std.com (Jeffrey B Kane)
- Date: Mon, 21 Sep 1992 11:30:00 -0400
I've been using LISP regularly now for about 6 months, but there is one
little point that I can't seem to find addressed in any of the "standard"
lisp books (including Steele). It is "How can you best write destructive
functions?"
I want to implement something where a parameter is passed in a similar
fashion to the "var" in Pascal or "aType* aParameterPtr" in C or "aType&
aParameter" in C++. This is particular important in two areas:
string manipulation
lists, where I need to change the first element of the list
An example might be my own version of "adjoin" or a (delete-substring
aString :start 2 :stop 4) kind of function.
Jeffrey