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

Commit

Permalink
Introduced &IGN for ignored variables.
Browse files Browse the repository at this point in the history
Used to be NIL, this is an incompatible change.  Rationale: otherwise
I would have to parse deconstructing lambda forms to distinguish from
other uses of NIL.
  • Loading branch information
tpapp committed Jun 4, 2012
1 parent 31b9b83 commit 5793b8c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion let-plus.lisp
Expand Up @@ -6,7 +6,7 @@

(defun ignored? (symbol)
"Return a boolean determining if a variable is to be ignored."
(not symbol))
(eq symbol '&ign))

(defun replace-ignored (tree)
"Replace ignored variables in TREE with a gensym, return a list of these as
Expand Down
18 changes: 9 additions & 9 deletions package.lisp
Expand Up @@ -2,22 +2,22 @@

(defpackage let-plus
(:use cl alexandria anaphora)
(:export
(:export

;; basic user interface

let+

&accessors &accessors-r/o &slots &slots-r/o &structure &structure-r/o


#:&ign &accessors &accessors-r/o &slots &slots-r/o &structure &structure-r/o
&values &array-elements &array-elements-r/o &flet &labels &macrolet
&symbol-macrolet &plist &plist-r/o &hash-table &hash-table-r/o

;; defining new forms

let+-expansion let+-expansion-for-list define-let+-expansion

;; extensions

&flet+ &labels+ lambda+ defun+ define-structure-let+ &fwrap &assert
&once-only &with-gensyms &complex))

&flet+ &labels+ lambda+ defun+ define-structure-let+ &fwrap &assert
&once-only &with-gensyms &complex))
6 changes: 3 additions & 3 deletions tests.lisp
Expand Up @@ -81,20 +81,20 @@ should)."

(addtest (let-plus-tests)
test-values
(let+ (((&values a nil c) (values 1 2 3)))
(let+ (((&values a &ign c) (values 1 2 3)))
(ensure-same a 1)
(ensure-same c 3)))

(addtest (let-plus-tests)
test-values-recursive
(let+ (((&values (a b) nil c) (values '(1 4) 2 3)))
(let+ (((&values (a b) &ign c) (values '(1 4) 2 3)))
(ensure-same a 1)
(ensure-same b 4)
(ensure-same c 3)))

(addtest (let-plus-tests)
test-array
(let+ ((#2A((a nil) (b c)) #2A((1 2) (3 4))))
(let+ ((#2A((a &ign) (b c)) #2A((1 2) (3 4))))
(ensure-same a 1)
(ensure-same b 3)
(ensure-same c 4))
Expand Down

0 comments on commit 5793b8c

Please sign in to comment.