/[gcl]/gcl/ansi-tests/ansi-aux.lsp
ViewVC logotype

Diff of /gcl/ansi-tests/ansi-aux.lsp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by pfdietz, Fri Jan 24 01:24:27 2003 UTC revision 1.27 by pfdietz, Fri Jan 24 04:22:54 2003 UTC
# Line 13  Line 13 
13  (defun notnot (x) (not (not x)))  (defun notnot (x) (not (not x)))
14    
15  (defmacro notnot-mv (form)  (defmacro notnot-mv (form)
16    `(apply #'values (mapcar #'notnot (multiple-value-list ,form))))    `(notnot-mv-fn (multiple-value-list ,form)))
17    
18  ;;; Macro to check that a function is returning a single value  (defun notnot-mv-fn (results)
19  (defmacro check-value (form &optional (num 1))    (if (null results)
20          (values)
21        (apply #'values
22               (not (not (first results)))
23               (rest results))))
24    
25    (defmacro not-mv (form)
26      `(not-mv-fn (multiple-value-list ,form)))
27    
28    (defun not-mv-fn (results)
29      (if (null results)
30          (values)
31        (apply #'values
32               (not (first results))
33               (rest results))))
34    
35    
36    ;;; Macro to check that a function is returning a specified number of values
37    ;;; (defaults to 1)
38    (defmacro check-values (form &optional (num 1))
39    (let ((v (gensym))    (let ((v (gensym))
40          (n (gensym)))          (n (gensym)))
41     `(let ((,v ,form)     `(let ((,v (multiple-value-list ,form))
42            (,n ,num))            (,n ,num))
43        (check-values-length ,v ,n ',form)        (check-values-length ,v ,n ',form)
44        (car ,v))))        (car ,v))))

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26