From nsiivola at common-lisp.net Sun Apr 4 23:22:48 2010 From: nsiivola at common-lisp.net (Nikodemus Siivola) Date: Sun, 04 Apr 2010 19:22:48 -0400 Subject: [alexandria.git] updated branch master: 043f980... doc/Makefile tweak Message-ID: The branch master has been updated: via 043f9804cbc3b91964b6cbdb72c1cdd1f300b3ad (commit) via e2480f345d17e5a40fa3bfdc9f499704ed570c32 (commit) from bb423c64814e13537262cfa799d16ea9447411ed (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 043f9804cbc3b91964b6cbdb72c1cdd1f300b3ad Author: Nikodemus Siivola Date: Mon Apr 5 02:21:50 2010 +0300 doc/Makefile tweak Make sure we build the documentation from the in-tree version of Alexandria. commit e2480f345d17e5a40fa3bfdc9f499704ed570c32 Author: Nikodemus Siivola Date: Mon Apr 5 02:21:35 2010 +0300 document ENSURE-FUNCTIONF ----------------------------------------------------------------------- Summary of changes: doc/Makefile | 3 ++- functions.lisp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 56e794a..85eb818 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -12,7 +12,8 @@ clean: clean-include rm -f *.pdf *.html *.info include: - sbcl --eval '(progn (require :asdf) (require :alexandria))' \ + sbcl --no-userinit --eval '(require :asdf)' \ + --eval '(let ((asdf:*central-registry* (list "../"))) (require :alexandria))' \ --load docstrings.lisp \ --eval '(sb-texinfo:generate-includes "include/" (list :alexandria) :base-package :alexandria)' \ --eval '(quit)' diff --git a/functions.lisp b/functions.lisp index 5a45d70..15032be 100644 --- a/functions.lisp +++ b/functions.lisp @@ -15,7 +15,8 @@ it must be a function name and its FDEFINITION is returned." (define-modify-macro ensure-functionf/1 () ensure-function) (defmacro ensure-functionf (&rest places) - "FIXME: UNDOCUMENTED!" + "Multiple-place modify macro for ENSURE-FUNCTION: ensures that each of +PLACES contains a function." `(progn ,@(mapcar (lambda (x) `(ensure-functionf/1 ,x)) places))) (defun disjoin (predicate &rest more-predicates) -- Alexandria hooks/post-receive From nsiivola at common-lisp.net Mon Apr 5 16:53:37 2010 From: nsiivola at common-lisp.net (Nikodemus Siivola) Date: Mon, 05 Apr 2010 12:53:37 -0400 Subject: [alexandria.git] updated branch master: 4907281... better docstring for MULTIPLE-VALUE-PROG2, a few more tests Message-ID: The branch master has been updated: via 4907281d91c17056a4ddfdc46cec512ed2859f0f (commit) from 043f9804cbc3b91964b6cbdb72c1cdd1f300b3ad (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4907281d91c17056a4ddfdc46cec512ed2859f0f Author: Nikodemus Siivola Date: Mon Apr 5 19:52:54 2010 +0300 better docstring for MULTIPLE-VALUE-PROG2, a few more tests ----------------------------------------------------------------------- Summary of changes: control-flow.lisp | 10 +++++----- package.lisp | 9 ++++++--- tests.lisp | 33 +++++++++++++++++++++++++-------- 3 files changed, 36 insertions(+), 16 deletions(-) diff --git a/control-flow.lisp b/control-flow.lisp index 0aafb2a..f262443 100644 --- a/control-flow.lisp +++ b/control-flow.lisp @@ -68,7 +68,7 @@ returns the values of DEFAULT if no keys match." ,(expand possibilities 0 random-number))))))) (defmacro xor (&rest datums) - "Evaluates its argument one at a time, from left to right. If more then one + "Evaluates its arguments one at a time, from left to right. If more then one argument evaluates to a true value no further DATUMS are evaluated, and NIL is returned as both primary and secondary value. If exactly one argument evaluates to true, its value is returned as the primary value after all the @@ -100,7 +100,7 @@ NIL." `(nth-value-or ,nth-value ,@(rest forms)) nil)))))) -(defmacro multiple-value-prog2 (first-form second-form &body body) - "Like CL:MULTIPLE-VALUE-PROG1, except it saves the values of the -second form." - `(progn ,first-form (multiple-value-prog1 ,second-form , at body))) +(defmacro multiple-value-prog2 (first-form second-form &body forms) + "Evaluates FIRST-FORM, then SECOND-FORM, and then FORMS. Yields as its value +all the value returned by SECOND-FORM." + `(progn ,first-form (multiple-value-prog1 ,second-form , at forms))) diff --git a/package.lisp b/package.lisp index c7f9bf1..b5ce17b 100644 --- a/package.lisp +++ b/package.lisp @@ -13,16 +13,19 @@ ;; REVIEW IN PROGRESS ;; ;; Control flow + ;; + ;; -- no clear consensus yet -- #:cswitch #:eswitch #:switch + ;; -- problem free? -- #:multiple-value-prog2 - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; REVIEW PENDING - ;; #:nth-value-or #:whichever #:xor + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; REVIEW PENDING + ;; ;; Definitions #:define-constant ;; Hash tables diff --git a/tests.lisp b/tests.lisp index e2904cc..c139568 100644 --- a/tests.lisp +++ b/tests.lisp @@ -138,6 +138,21 @@ (13.0 :oops)) :yay) +(deftest multiple-value-prog2.1 + (multiple-value-prog2 + (values 1 1 1) + (values 2 20 200) + (values 3 3 3)) + 2 20 200) + +(deftest nth-value-or.1 + (multiple-value-bind (a b c) + (nth-value-or 1 + (values 1 nil 1) + (values 2 2 2)) + (= a b c 2)) + t) + (deftest whichever.1 (let ((x (whichever 1 2 3))) (and (member x '(1 2 3)) t)) @@ -156,6 +171,16 @@ 1 t) +(deftest xor.2 + (xor nil nil 1 2) + nil + nil) + +(deftest xor.3 + (xor nil nil nil) + nil + t) + ;;;; Definitions (deftest define-constant.1 @@ -1677,14 +1702,6 @@ :type-error)) :type-error) -(deftest nth-value-or.1 - (multiple-value-bind (a b c) - (nth-value-or 1 - (values 1 nil 1) - (values 2 2 2)) - (= a b c 2)) - t) - (deftest doplist.1 (let (keys values) (doplist (k v '(a 1 b 2 c 3) (values t (reverse keys) (reverse values) k v)) -- Alexandria hooks/post-receive From alendvai at common-lisp.net Mon Apr 12 07:50:57 2010 From: alendvai at common-lisp.net (Attila Lendvai) Date: Mon, 12 Apr 2010 03:50:57 -0400 Subject: [alexandria.git] updated branch master: a5d7ec2... simple-style-warning & co: better compatibility with ccl Message-ID: The branch master has been updated: via a5d7ec2a97cc0b0f45a17298d781665fd6d19bb8 (commit) from 4907281d91c17056a4ddfdc46cec512ed2859f0f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a5d7ec2a97cc0b0f45a17298d781665fd6d19bb8 Author: Attila Lendvai Date: Sun Apr 11 20:51:14 2010 +0200 simple-style-warning & co: better compatibility with ccl ----------------------------------------------------------------------- Summary of changes: conditions.lisp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conditions.lisp b/conditions.lisp index 196a56e..ac471cc 100644 --- a/conditions.lisp +++ b/conditions.lisp @@ -6,7 +6,7 @@ use as an initialization form for structure and class-slots, and a default value for required keyword arguments." (error "Required argument ~@[~S ~]missing." name)) -(define-condition simple-style-warning (style-warning simple-warning) +(define-condition simple-style-warning (simple-warning style-warning) ()) (defun simple-style-warning (message &rest args) @@ -19,7 +19,7 @@ a default value for required keyword arguments." ;; implementation. But even then it's still inspectable from the ;; debugger... (define-condition simple-reader-error - #-sbcl(reader-error simple-error) + #-sbcl(simple-error reader-error) #+sbcl(sb-int:simple-reader-error) ()) -- Alexandria hooks/post-receive