Import de quelques trucs qui traînaient dans ma branche.
This commit is contained in:
parent
315ba199b7
commit
73c0c1e990
|
@ -1,3 +1,5 @@
|
|||
;; CLTL 2 et 2.15
|
||||
|
||||
;; TODO : est-ce que cette fonction existe ?
|
||||
(defun tp (x) t)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)))
|
||||
|
|
11
util.lisp
11
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)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user