www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 73c0c1e990113184caa3bc886d64f0debe776b0c
parent 315ba199b75e5d7869e7f83d349f877085cceea0
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date:   Sun,  7 Nov 2010 06:16:48 +0100

Import de quelques trucs qui traînaient dans ma branche.

Diffstat:
Mimplementation/types.lisp | 2++
Mmatch.lisp | 5++---
Mtest-unitaire.lisp | 8++++----
Mutil.lisp | 11++++++++---
4 files changed, 16 insertions(+), 10 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -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)))