I have to add that loking trough your code you're using :use, :require
etc in a odd manner...Look at this for example in deriva.core.clj
(ns com.lambder.deriva.core
(:refer-clojure :include [=])
(:use clojure.tools.macro com.lambder.deriva.utils)
(:require [clojure.zip :as zip]
[clojure.walk :refer (macroexpand-all)]))
(set! *warn-on-reflection* true)
(require 'clojure.tools.macro)
(in-ns 'clojure.tools.macro)
(defn expand-all-with [m-funs form]
(binding [macro-fns m-funs]
(expand-all form)))
(in-ns 'com.lambder.deriva.core)
(use 'clojure.tools.macro)
... ... What exactly led you to do this? Firstly you :refer-clojure but
you :include [=] which is already referred. Secondly, you :use
clojure.tools.macro ut later on you require it too! You generally don't
want to change namespaces like that... whatever you need to use just
declare it at the top. Here is how I'd write the exact same thing:
(ns com.lambder.deriva.core
(:require [clojure.zip :as zip] [clojure.tools.macro :refer :all]
[com.lambder.deriva.utils :refer :all]
[clojure.walk :refer [macroexpand-all]])) why would you want to inject
'expand-all-with'into the clojure.tools.macrons?
HTH, Jim
On 01/10/13 13:10, Jim wrote:
that's not technically a bug but rather more idiomatic code. In fact
extend-protocol expands in to a bunch of extend-type calls just like
your code... :)
Jim
On 01/10/13 13:05, Daniel Kwiecinski wrote:
All nitpickings are warmly welcome! ;)
I'll do my best to make it high quality lib.
Report all suggestions/bugs at https://github.com/lambder/Deriva/issues
Kind Regards,
Daniel Kwiecinski (lambder)
On 1 October 2013 13:00, Jim <jimpil1...@gmail.com
<mailto:jimpil1...@gmail.com>> wrote:
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
<mailto: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
<mailto: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
<mailto: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
<mailto: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
<mailto:clojure%2bunsubscr...@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
<mailto:clojure%2bunsubscr...@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.
--
--
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.