wow! I've not tried it yet but looks very cool...would you mind a bit of
nitpicking? In your java.clj you've got a bunch of 'extend-type' calls:
(extend-type clojure.lang.Symbol
ExpressionTree
(to-tree [this] (symbol this)))
(extend-type Character
ExpressionTree
(to-tree [this] (symbol (str this))))
(extend-type String
ExpressionTree
(to-tree [this] (symbol this)))
(extend-type Number
ExpressionTree
(to-tree [this] this))
(extend-type clojure.lang.PersistentVector
ExpressionTree
(to-tree [this] (mapv to-tree this))) Looking at this code makes me
think you were actually looking for 'extend-protocol' rather than
'extend-type'. Something like this: (extend-protocol
ExpressionTreeclojure.lang.Symbol (to-tree [this] (symbol this))
Character (to-tree [this] (-> this str symbol))String (to-tree [this]
(symbol this))Number (to-tree [this] this)clojure.lang.PersistentVector
(to-tree [this] (mapv to-tree this)) )
Jim
On 01/10/13 12:48, Daniel Kwiecinski wrote:
Hi All,
I have just pushed Deriva - automated algorithmic differentiation for
Clojure and Java.
The code is on https://github.com/lambder/Deriva
And I have blog post on
http://lambder.com/articles/deriva-automatic-algorythmic-differentiation-for-java-and-clojure/
It uses algebraic expression trees (and not so algebraic case operator
for non analytic functions) and performs symbolic manipulation on it.
The end result is java bytecode with zero function calls, just
primitive operations (apart from calling java.lang.Math funs)
Kind Regards,
Daniel Kwiecinski (lambder)
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient
with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.