Created
February 8, 2013 01:56
-
-
Save abp/4736021 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def g | |
{:a 1 | |
:d/b 2 | |
:b/a (fnk [a] (* a 7)) | |
:x (fnk [b/a [d/b 2] [c 3]] (+ b/a d/b c))}) | |
(def cg (compile-graph g)) | |
(iterate cg) | |
; => {:x 12, :b/a 7, :d/b 2, :a 1} | |
(iterate cg {:a 7 :x 15} :a) | |
; => {:d/b 2, :b/a 49, :x 54, :a 7} | |
(iterate cg {:b/a 11 :a 7 :x 15} :x) | |
; => {:d/b 2, :x 15, :a 7, :b/a 11} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment