On Sat, Aug 25, 2012 at 6:18 PM, Timothy Baldridge <tbaldri...@gmail.com> wrote:
>
>>> It's not currently supported. Ticket welcome. If you have ideas about
>>> a good approach that's even better. Part of the problem is that
>>> Clojure fns are just JS fns.
>>
>>
>
> Can't we just set the attribute on the function? This works under Chrome,
> not sure about other browsers:
>
> z = function(x) { return x;}
> function (x) { return x;}
> z(1)
> 1
> z.foo = 1
> 1
> z
> function (x) { return x;}
> z.foo
> 1
> z(1)
> 1
>
>
> This is the approach I took for clojure-py. You can either provide a .meta()
> method that will be called to get the metadata, or you can put ._meta on
> your object and that attribute will be set/retrieved instead. Of course,
> this isn't immutable, but it would support meta and alter-meta.

Oops, actually the mutability is a showstopper. Looks like we need a
fn wrapper type which has the necessary extra field.

David

-- 
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

Reply via email to