Skip to content

Instantly share code, notes, and snippets.

@sjl

sjl/foo.markdown Secret

Created March 30, 2020 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjl/191bbea3c7205baaab48c0765c2ce1e7 to your computer and use it in GitHub Desktop.
Save sjl/191bbea3c7205baaab48c0765c2ce1e7 to your computer and use it in GitHub Desktop.
(defmacro serapeum.exporting:defclass (name supers &body (slots . options))
  ...)

is equivalent to:

(defmacro serapeum.exporting:defclass (name supers &rest more-stuff)
  (destructuring-bind (slots . options) more-stuff)
    ...))

which is equivalent to:

(defmacro serapeum.exporting:defclass (name supers &rest more-stuff)
  (destructuring-bind (slots &rest options) more-stuff)
    ...))

They use &body instead of &rest as an indentation hint.

They use the dotted-list form to avoid having to do destructuring-bind, and also because it provides a nicer documentation experience when your editor shows your the lambda list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment