On Wed, Jun 24, 2009 at 10:07 AM, Nicolas Oury <nicolas.o...@gmail.com>wrote:

>
> Dear all,
>
> Sometimes, when I write some macros and applied them to special case, I
> got a "create-struct : must supply keys" exception.
>
> I think it should be possible to write (create-struct) and have an empty
> structure definition returned.
>
> With (struct (create-struct)) more or less equivalent to creating an
> empty map.
>
> Currently, it results in some special case in macros or adding a :dummy
> field to any generated struct.
>

If you don't know the keys in advance then why not create a map instead? For
me the point of using a struct is that you get optimized access to a known
set of keys and the struct documents the keys you expect to use. You can't
get those benefits without knowing the keys.

-- 
R. Mark Volkmann
Object Computing, Inc.

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