On Sun, Feb 13, 2011 at 11:26 PM, Seth <[email protected]> wrote:
> whats wrong with implementing Fn and IMeta?

I don't know. But when I checked a normal function's supers I saw IFn,
AFn, and AFunction; and when I checked a vector's I saw only IFn of
those three. I also saw IObj, did a .getMethods on it, and the methods
there were obviously for getting and setting metadata.

If there's also a Fn and an IMeta then there seems to be some
redundancy, on the one hand between IMeta and IObj and on the other
some among IFn, Fn, AFn, and AFunction -- perhaps the first two and
the latter two. I mean, either objects take metadata or they don't, so
a single metadata-enabling interface seems to suffice, and either
objects are "true functions" that should produce true from fn?, are
callable and produce true from ifn? but are not "true functions", or
are neither, which the IFn interface (ifn?) and either the AFn or the
AFunction class (fn?) would seem to suffice to distinguish.

Perhaps someone who knows more about Clojure's internals can shed some
light on why all these interfaces and classes exist and whether and
how they serve distinct purposes.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to