Dan <redalas...@gmail.com> writes: >> I guess I want to advocate - don't merely replicate the things with >> which you are familiar. Try to do things in the Clojure way. If your >> logical structure is a mapping of names to values, please use a map. > > I tend to replace every instance of creating classes with creating > structs which, if I understood correctly, are maps too. Good habit or > should structs not be abused?
I'm pretty sure structs are only appropriate for when you need to eek the absolute last iota of performance out of a collection, in which case they can provide greater speed than maps. But since the list of keys is fixed, it means it's more effort to add or rename a key than it is with a map. You shouldn't trade that flexibility for speed until (0) you are pretty sure the keys are not going to change soon and (1) you know you can't get the speed you need from maps. Neither of these are true when you're just starting out on a piece of code. -Phil --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---