El miércoles 28 de diciembre de 2011 11:01:16 UTC+1, Ambrose
Bonnaire-Sergeant escribió:
>
> I would recommend sticking with namespaced keywords to avoid clashes with
> var metadata keys.
>
> Remember qualified keywords respect namespace aliasing and ::keyword is
> qualified in the current namespace.
> These can help making the code more readable.
>
OK
You could store keywords in vars if namespaced keywords really bothered you.
>
> (def mykey ::mykey)
>
My main concern is that when using reader macros for metadata I have to
fully qualify it. For instance, I must write:
(defdatatype
::Streams
Nil
(^:ml.datatypes/lazy Cons elem stream))
instead of
(defdatatype
::Streams
Nil
(^:lazy Cons elem stream))
But I suppose the benefits of namespacing outweight these inconveniences.
Thanks,
Juan Manuel
> Thanks,
> Ambrose
>
> On Wed, Dec 28, 2011 at 5:54 PM, JuanManuel Gimeno Illa <[email protected]
> > wrote:
>
>> I've been writing some code which adds some keywords in metadata
>> associated to vars. Initially I used namespaces keywords to not collide
>> with other keywords. The problem is that having to namespace these keywords
>> makes the code, at least, ugly. Is it any consensus in the use of keywords
>> in metadata? I've done some search of examples and, most of them, does not
>> use namespaced keywords, but I am not sure.
>>
>> Thanks,
>>
>> Juan Manuel
>>
>> --
>> 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 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