Sat Nov 21 18:31:09 UTC 2009  pix@kepibu.org
  * Tired, probably doing stupid things
hunk ./tests.lisp 38
-                        ("div" ("i" . ?i)
-                               ("span" . ?span)))
+                        ("div" (">i" . ?i)
+                               ;("i" . #t(list ?j ?i))
+                               ("span>i" . ?span)))
hunk ./tests.lisp 44
+(match (#T(html (:model dom)
+                ("i" . ?i);#t(list ?j ?i))
+                ("span>i" . ?span))
+          "<div>I do <i>not</i> like cheese.</div><div><span>I like <i>cheese</i>.</span></div>")
+  (values i span))
+
hunk ./tests.lisp 51
-(match (#t(lhtml ("div::content" . #t(regexp+ "^f(o+)" (?o))))
+(match (#t(html ("div::content" . #t(regexp+ "^f(o+)" (?o))))
hunk ./unify.lisp 11
+(defun merge-environments (env1 env2)
+  (assert (or (unify::empty-environment-p env1)
+              (equal (unify::environment-variables env1)
+                     (unify::environment-variables env2))))
+  (format t "ev1: ~s, ev2: ~s~%" (unify::environment-values env1) (unify::environment-values env2))
+  (format t "q: ~s~%" (unify::find-variable-value '?i env1))
+  (unify::fill-environment (unify::environment-variables env1)
+                           (mapcar (lambda (a b) (format t "a: ~s, b: ~s~%" a b) (append a b))
+                                   (unify::environment-values env1)
+                                   (unify::environment-values env2))
+                           (make-empty-environment)))
+
hunk ./unify.lisp 26
+  (declare (optimize debug))
hunk ./unify.lisp 29
-        (setf
-         env
hunk ./unify.lisp 30
-           #+(or) (if (null val) (cerror "continue" "null!"))
-          (format t "mel: ~s, css: ~s, tpl: ~s~%" val css-specifier template)
hunk ./unify.lisp 31
+            ;; FIXME: make possible to say things like ("div" . #t(list ?first-div &rest))
+            #+(or)
+            ((typep template 'css-selector-template)
+             (format t "hey! ~s~%" template)
+             (let ((menv (reduce #'merge-environments
+                                 (mapcar (curry #'unify template)
+                                         val))))
+               (unify::fill-environment (unify::environment-variables menv)
+                                        (unify::environment-values menv)
+                                        env)))
hunk ./unify.lisp 42
-             #+(or) (format t "template-p~%")
+             (let ((menv (reduce #'merge-environments
+                                 (mapcar (curry #'unify template)
+                                         val))))
+               (unify::fill-environment (unify::environment-variables menv)
+                                        (unify::environment-values menv)
+                                        env))
+             #+(or)
hunk ./unify.lisp 50
-             #+(or) ;; FIXME: in the case of multiple items in val, this will only return one.
+             #+(or)
hunk ./unify.lisp 52
-                   :do (setf env (unify template element env))
-                   :finally (return env)))
+                   :do (unify template element env)))
hunk ./unify.lisp 54
-             #+(or) (format t "variable-p~%")
-             (unify::extend-environment template val env))
-            (t (error "whoops: ~s, ~s" css-specifier template))))))
+             ;; *ahem* FIXME: this makes ("a" ("b" . ?b)) possible,
+             ;; but will cause the wrong thing to happen for [_$_]
+             ;; ("a" ("b" . ?b) ("#b" . ?b))
+             ;(alexandria:if-let ((varval (find-variable-value template env)))
+             ;  (nconc varval val)
+             (unify::var-unify template val env)
+             #+(or)
+               (unify::extend-environment template val env));)
+            (t (error "whoops: ~s, ~s" css-specifier template)))))