+(define (unionE L1 L2)
+ (cond
+ ((null? L1) L2)
+ ((member (first L1) L2) (unionE (rest L1) L2))
+ ((cons (first L1) (unionE (rest L1) L2)))))
+(println "unionE/union")
+(println (unionE L M))
+(println (unionE N L))
+(println (union N L))
+
+;(trace true)
+
+(setq T '(((4)((2 5))((((((6 7)))))))))
+(define (prof L)
+ (cond
+ ((null? L) 0)
+ ((atom? L) 0)
+ ((max (+ 1 (prof (first L))) (prof (rest L))))))
+(println "prof")
+(println (prof L))
+(println (prof T))
+
+;(trace nil)
+;(trace true)
+
+(define (aplatir L)
+ (cond
+ ((null? L) nil)
+ ((atom? L) (list L)) ;FIXME: the "casting" is not working properly
+ ((append (aplatir (first L)) (aplatir (rest L))))))
+(println "aplatir/flat")
+;(println (aplatir T))
+(println (flat T))
+
+;(trace nil)
+
+(define (elim L)
+ (cond
+ ((null? L) '())
+ ((member (first L) (rest L)) (elim (rest L)))
+ ((cons (first L) (elim (rest L))))))
+(println "elim/unique")
+(println (elim C))
+(println (unique C))
+
+(define (reverseL L)
+ (cond
+ ((null? L) '())
+ ((append (reverseL (rest L)) (list (first L))))))
+(println "reverseL/reverse")
+(println (reverseL L))
+(println (reverse L))
+
+(define (list< n L)
+ (cond
+ ((null? L) '())
+ ((>= (first L) n) (list< n (rest L)))
+ ((cons (first L) (list< n (rest L))))))
+(println "list<")
+(println (list< 5 L))
+(println (list< 5 C))
+
+(define (list>= n L)
+ (cond
+ ((null? L) '())
+ ((< (first L) n) (list>= n (rest L)))
+ ((cons (first L) (list>= n (rest L))))))
+(println "list>=")
+(println (list>= 5 C))
+
+;(trace true)
+
+(define (qsort L)
+ (cond
+ ((null? L) '())
+ ((append
+ ;the pivot is the first element of the list
+ (qsort (list< (first L) (rest L)))
+ (cons (first L) '())
+ (qsort (list>= (first L) (rest L)))))))
+(println "qsort")
+(println (qsort C))
+
+;(trace nil)
+
+;we suppose both lists are flat
+(setq L1 '(A ? ? B C D ?))
+(setq L2 '(? A B ? C ? ? D))
+
+(define (removeC c L)
+ (cond
+ ((null? L) '())
+ ((= c (first L))) (removeC c (rest L))
+ (((cons (first L) (removeC c (rest L)))))))
+(println (removeC A L1))
+
+(define (filtre L1 L2 C)
+ (cond
+ ((and (null? L1) (null? L2)) true)
+ ((and (not (null? L1)) (null? L2)) nil)
+ ((and (null? L1) (not (null? L2))) nil)
+ ((and (inclu L1 L2) (inclu L2 L1) true))))
+;(println "filtre")
+;(println (filtre L1 L2 ?))
+