[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Destructuring and &whole
- To: email@example.com
- Subject: Destructuring and &whole
- From: firstname.lastname@example.org (Stanley T. Shebs)
- Date: Fri, 30 Jan 87 09:37:33 MST
The point has been made that &whole might be used for detecting failed
attempts at destructuring, but has been countered by the observation that
the CL standard doesn't say anything about what happens if destructuring
doesn't work. This greatly limits the usefulness of destructuring - persons
writing robust code must do all the dissection by hand. (This situation
also comes up in functional languages, whose proponents frequently boast of
the destructuring capability inherent in function calls, but who shrug if a
program fails utterly because of an argument mismatch.)
I see several choices, listed in order of difficulty:
1. Flip a coin to decide whether &whole can appear in several places or not,
change nothing else.
2. Specify some sort of behavior for anomalous situations during dissection,
perhaps no more than a condition to be handled by the error system.
3. Augment destructuring syntax to allow for several possibilities to be
tried in order. For instance, the two forms of defsetf could be decided
upon, based only on multiple patterns in the parameter list!
I favor the last, but it's probably not politically feasible :-). Perhaps