Hi,

This may not be the answer you are looking for. But, kooking at the example
you gave, you will need to execution environment of the function to
determine the binding of y. It could vary based on where it is invoked.
That is because, if the function call was wrapped inside a 'binding form
then the value of y would be different. And, isn't this something that is
determined during execution of the function?

Example:

(def ^:dynamic y 10)

(defn testfn [x]
    (+ x y))

(testfn 10)

==> print 20

(binding [y 100]
 (testfn 10))

==> prints 110.


So, unless you want to assume the free variables are always lexically
scoped, that value you may want to deref would vary.

Maybe you have a very specific scenario where you need to do what you want.
More details would help.

Thanks
Guru





On Tue, Nov 26, 2013 at 4:19 AM, henry w <henryw...@gmail.com> wrote:

> Sad not to get any replies - even to tell me if it is a bad idea or not
> possible. :-(
>
> Assuming it is not possible, am I right in saying that at the moment, in
> Clojure, 'code is data' really only applies until code is compiled?
>
> I realise compiled functions can still be passed around, assigned to vars
> and so on.
>
>
>  --
> --
> 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.

Reply via email to