Skip to content
This repository has been archived by the owner on Mar 7, 2018. It is now read-only.

Commit

Permalink
Added docstrings for defstruct+, added &fwrap form.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpapp committed May 25, 2011
1 parent 8760eb5 commit 3e941a6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions extensions.lisp
Expand Up @@ -49,9 +49,19 @@ option is accepted. The defaults are &NAME and &NAME-R/O."
`(progn
(defstruct ,name-and-options ,@slot-descriptions)
(define-let+-expansion (,r/w-prefix (,@slot-names))
,(format nil "LET+ form for slots of the structure ~A." name)
`(let+ (((&structure ,',conc-name ,,@variable-name-pairs) ,value))
,@body))
(define-let+-expansion (,r/o-prefix (,@slot-names))
,(format nil "LET+ form for slots of the structure ~A. Read-only."
name)
`(let+ (((&structure-r/o ,',conc-name ,,@variable-name-pairs)
,value))
,@body)))))

(define-let+-expansion (&fwrap (name))
"Wrap closure in the local function NAME. Calls to name will call the
closure"
`(let+ (((&flet ,name (&rest arguments)
(apply ,value arguments))))
,@body))

0 comments on commit 3e941a6

Please sign in to comment.