Skip to content

Functions -> setf Functions needs better example #544

@bpseudopod

Description

@bpseudopod

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 its setf counterpart.
  • (setf hello) has a number of unrelated side effects, cluttering the code and making its purpose unclear.
  • (setf hello) ignores the convention that a setf 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 and setf counterpart with a more obviously symmetrical relationship that follows setf conventions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions