[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Writing Destructive Functions



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