Skip to content

Commit

Permalink
Notes
Browse files Browse the repository at this point in the history
  • Loading branch information
fogus committed Jul 24, 2013
1 parent 636efbf commit 63f3170
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions src/main/clojure/clojure/core/unify.clj
Original file line number Diff line number Diff line change
Expand Up @@ -287,24 +287,19 @@
:last "Argento"
:genre :giallo})

(unifier ['?first '?last]
'{?first "Dario", ?last ?first})
;;=> {?first "Dario", ?last "Argento"}

(unifier ['?first "Argento"]
["Dario" '?last])

(subst '[1 2 ?x ?y]
'{?x [3 4 ?x 6]})

(unify '{:first ?nickname
:last ?last
:genre :giallo}

'{:last "Argento"
:genre :giallo})

;;=> ["Dario" "Argento"]


(subst '[1 2 ?x ?y]
'{?x [3 4 ?y 6]})


;;=> [1 2 [3 4 ?y 6] ?y]


(unifier '[(?a * ?x | 2) + (?b * ?x) + ?c]
'[?z + (4 * 5) + 3])
Expand Down

0 comments on commit 63f3170

Please sign in to comment.