-
-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functions -> setf Functions needs better example #544
Comments
hello, WDYT of this?
|
The treatment of I think it's pretty important to talk explicitly about places, as the OP mentioned. CLtL2 calls them "generalized variables", which is too many syllables IMO. Perhaps a basic structure like this:
Other random thoughts:
|
ACK, thanks. I think I covered the last point with |
The current example did not help me approach custom places. Issues include:
hello
is not an "accessor" of anything, therefore(setf hello)
doesn't make much sense to begin with.(setf hello)
ignores the argument convention at the beginning of the section, and so doesn't show how a lambda list changes between a function and itssetf
counterpart.(setf hello)
has a number of unrelated side effects, cluttering the code and making its purpose unclear.(setf hello)
ignores the convention that asetf
form should return the place's new value.My experience: Today I wanted to write a
setf
function--the Hyperspec isn't very clear on the matter, so I turned to the Cookbook, and found the matter even less clear here. (I ended up using another resource.) A better example would consist of an accessor function andsetf
counterpart with a more obviously symmetrical relationship that followssetf
conventions.The text was updated successfully, but these errors were encountered: