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

This commit is contained in:
Georges Dupéron 2010-11-07 06:16:48 +01:00
parent 315ba199b7
commit 73c0c1e990
4 changed files with 16 additions and 10 deletions

View File

@ -1,3 +1,5 @@
;; CLTL 2 et 2.15
;; TODO : est-ce que cette fonction existe ?
(defun tp (x) t)

View File

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

View File

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

View File

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