From 73c0c1e990113184caa3bc886d64f0debe776b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Sun, 7 Nov 2010 06:16:48 +0100 Subject: [PATCH] =?UTF-8?q?Import=20de=20quelques=20trucs=20qui=20tra?= =?UTF-8?q?=C3=AEnaient=20dans=20ma=20branche.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation/types.lisp | 2 ++ match.lisp | 5 ++--- test-unitaire.lisp | 8 ++++---- util.lisp | 11 ++++++++--- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/implementation/types.lisp b/implementation/types.lisp index fd8e90e..9464d23 100644 --- a/implementation/types.lisp +++ b/implementation/types.lisp @@ -1,3 +1,5 @@ +;; CLTL 2 et 2.15 + ;; TODO : est-ce que cette fonction existe ? (defun tp (x) t) diff --git a/match.lisp b/match.lisp index 2096b4e..95a5c12 100644 --- a/match.lisp +++ b/match.lisp @@ -335,10 +335,10 @@ (is-predicate (when (and (pattern-match `(nil nil ,(car pattern) nil nil) expr) (cond - ;; (? and symbole-1 ... symbole-n) + ;; (? _ and symbole-1 ... symbole-n) ((eq 'and (second pattern)) (every (lambda (predicat) (funcall predicat expr)) (cddr pattern))) - ;; (? or symbole-1 ... symbole-n) + ;; (? _ or symbole-1 ... symbole-n) ((eq 'or (second pattern)) (some (lambda (predicat) (funcall predicat expr)) (cddr pattern))))) (acons-capture capture-name expr nil))) @@ -1285,4 +1285,3 @@ (deftest (match defmatch) (test-match-bar 42) 'i-m-else) - diff --git a/test-unitaire.lisp b/test-unitaire.lisp index ab06ed1..ab6d4bc 100644 --- a/test-unitaire.lisp +++ b/test-unitaire.lisp @@ -132,16 +132,16 @@ (erase-tests test-unitaire) (deftest (test-unitaire copy-all) - (let ((foo #(a b (1 #(2 4 6) 3) c)) - (copy-of-foo (copy-all foo))) + (let* ((foo #(a b (1 #(2 4 6) 3) c)) + (copy-of-foo (copy-all foo))) copy-of-foo (setf (aref (cadr (aref copy-of-foo 2)) 1) (cons 'MODIFIED (random 42))) (equalp foo #(a b (1 #(2 4 6) 3) c))) t #'booleq) (deftest (test-unitaire copy-all) - (let ((foo #(a x (1 #(2 4 7) 5) c)) - (copy-of-foo (copy-all foo))) + (let* ((foo #(a x (1 #(2 4 7) 5) c)) + (copy-of-foo (copy-all foo))) copy-of-foo (setf (aref (cadr (aref foo 2)) 1) (cons 'MODIFIED (random 42))) (equalp foo #(a x (1 #(2 4 7) 5) c))) diff --git a/util.lisp b/util.lisp index 698775f..3b631e1 100644 --- a/util.lisp +++ b/util.lisp @@ -68,8 +68,12 @@ for line = (read fd nil 'eof) while (not (eq line 'eof)) collect line - finally (close fd) - )))) + finally (close fd))))) + +(defun propper-list-p (l) + (or (null l) + (and (consp l) + (propper-list-p (cdr l))))) (defun m-macroexpand-1 (macro) ()) @@ -125,4 +129,5 @@ ((characterp data) data) (t - (warn "copy-all : Je ne sais pas copier ~w" data)))) + (warn "copy-all : Je ne sais pas copier ~w" data) + data)))