Hahaha, thanks Philip. Does it really take a doctorate to understand
classification of elephants?
I think the overall consensus is that having basic type checking is good... but
over doing types is bad.
Would this be a reasonable guideline for using types?
1. Types are useful for structures that HOLD data (ints, strings, maps,
arrays… ) because they provide ways defining standard operations to manipulate
data that make sense in the context of that type of data. It is helpful to have
a type checker check that I am not accessing the 6th element of a hashmap or
that I am adding 10 to "Hello".
2. When a particular data-structure is sufficient for holding information,
then its better to just use the data-structure because we have so many generic
operations predefined.
> For example, if I have to model customers in a line. I wouldn't have
type CUSTOMER and type LINE. I would just represent this as a QUEUE of
MAPS….
----
However… I find that I am writing a lot of statements like this:
(cond (hash-map? v)
……
(vector? v)
……
(list? v)
…..
:else …..)
I'm not sure a type checker will help in that instance.
--
--
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.