Hugo Duncan <[email protected]> writes:

> [email protected] (Phillip Lord) writes:
>
>> I'm build a library which provides a DSL for building ontologies.
>> Underneath this backs onto a Java API. The library works by provide some
>> macros, which create Java objects then intern them into the local
>> namespace. 
>
>> With the documentation, I can just add this to the metadata. But there
>> is a problem; I also need this in the underlying Java objects, so that
>> when the ontology is serialised, all the documentation goes with it. So
>> now I have the documentation in two places. 
>
> Could you initialise the var metadata using the docstring pulled from
> the java object. You would probably need your macros to generate
> alter-var-root forms to add the metadata.


Yes, I thought about that. I already control the macros which create the
vars, so I could add the metadata at that time. However, the link
between the two is then broken. I've already written code, for example,
which allows me to pull documentation in from properties files (for
i18n). So, the documentation on the var would need updating. Again,
doable. But ugly. 

If I could add doc as a function rather than just a string, then then
problem would go away. But, alas, it's not pluggable in this way. 

Phil

-- 
-- 
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
--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to