Re: Conceptual difference between map and class

2020-03-31 Thread James Gatannah
It might be worth mentioning that, ultimately, python class instances are syntactical sugar built around an internal __dict__. It gets twistier, since classes are also instances of the base class object. It would be tricky (though I've seen an example...maybe in Joy of Clojure? I think the

Re: Conceptual difference between map and class

2020-03-31 Thread Matching Socks
Witty and instructive: http://wiki.c2.com/?ClosuresAndObjectsAreEquivalent -- 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

Re: Conceptual difference between map and class

2020-03-31 Thread Justin Smith
I think it's also important here that Clojure methods are actual Java methods - Clojure likes to stay close to the host functionality. A map with a function isn't a class with a method because the JVM bytecode doesn't let you invoke it that way directly. A Clojure function is not a method because

Re: Conceptual difference between map and class

2020-03-31 Thread Jason Felice
A subtle difference between a map of functions and a Python class is that the class has implicit "self" or "this". Otherwise, these are semantically the same. Well, ignoring that Clojure maps are immutable. In fact, C++ compilers compile methods by inserting a first "this" argument and mangling

Conceptual difference between map and class

2020-03-31 Thread Dieter Van Eessen
Hello, I've got a clojure and a python piece of code. Both seem to create what can be considered an instance of a class. Wherein lies the conceptual difference? Python: class MYCLASS(): def __init__(self, x): self.x = x def MYMETHOD(self): ... def MYFUNCTION():