On Tue, Jun 16, 2009 at 12:18 PM, hari sujathan <[email protected]> wrote:
>
> I was trying to look from some mathematical concepts by representing -
> OOP's inheritance by tree/graph structurtes(tree for single , and
> graph
> for multiple inheritence) with classes acting as each node.
> With functional programming - nodes are each block of code..
I'm still not clear on what it is you are looking for. In case I am
understanding you correctly, have you considered using functions that
return classes in place of classes at each node? Is this anything like
what you are looking for?
user=> (declare classes)
#'user/classes
user=> (def tree { #(classes 1) #(classes 0) })
#'user/tree
user=> (def classes [String Object])
#'user/classes
user=> (doseq [[k v] tree] (println (str (k) " -> " (v))))
class java.lang.Object -> class java.lang.String
nil
user=> (def classes [Class Object])
#'user/classes
user=> (doseq [[k v] tree] (println (str (k) " -> " (v))))
class java.lang.Object -> class java.lang.Class
nil
- J.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---