4 ms·
Yes you can. Check out my language Babel-17 (http://www.babel-17.com http://www.babel-17.com) .
by babel17 15y ago
Yes you can. Check out my language Babel-17 (http://www.babel-17.com http://www.babel-17.com) .
- thesz 15y ago>>So you cannot have proper functional language with OO. >Yes you can. Check out my language Babel-17 I failed to see how purely functional structured programming address the need of identity for objects. Could you elaborate a little more?
- loup-vaillant 15y agoNoob question: what the hell are you needing identity for?
- thesz 15y agoTo differentiate objects one from another. http://en.wikipedia.org/wiki/Identity_%28object-oriented_programming%29 http://en.wikipedia.org/wiki/Identity_%28object-oriented_pro... "identity is the basis for polymorphism in object-oriented programming." In a purely functional object-oriented programming you don't need identity. But then that practice is almost indistinguishable from usual pure functional programming we have for at least 20 years with Haskell.
- loup-vaillant 15y agoForgive my insistence, but, what kind of problem does the ability to differentiate objects from one another solves? What kind of programs are made simpler by this ability? Besides, I don't see how you would need identity in the sense of being structurally-equal-but-not-the-same for class based polymorphism. You could perfectly do this without any side effect, despite what the `final` keyword in Java might mean. By "identity" Wikipedia probably means something like "you think I'm a Foo, which is right, but underneath, I'm a special kind of Foo: a Bar. By the way, there are others special kinds of Foo: the Baz, the Fiz, the Buz…". In other words, subtyping is the basis for polymorphism in OOP.
- thesz 15y ago>Forgive my insistence, but, what kind of problem does the ability to differentiate objects from one another solves? What kind of programs are made simpler by this ability? Oh, I don't know. I am not an expert in OO* at all. All I know is that for something to be true OO it has to have objects with identities. I was told so. ;) All I know about OO is Liskov substitution principle. Where it is unnecessary I tend to use State monad and immutable objects. >subtyping is the basis for polymorphism in OOP. Which can be solved by several means, interfaces and inheritance being two of them.
- babel17 15y ago> All I know is that for something to be true OO it has to have objects with identities. I was told so. ;) Well, you were told wrong things :-)
- thesz 15y agoPlease, list object-oriented systems with objects with identities and object-oriented systems without those. Count both. Discuss. ;) Alan Kay, who coined term "object-oriented" described object-oriented system as an assembly of objects communicating by message passing. Message passing requires identities (and state, except in severely reduced form).
- babel17 15y agoMessage passing does require a sender, a receiver, and a message. You can have those in purely functional programming. No identity needed. But if you really want one, you can have it: Two objects are identical, if they react to all messages in the same way. You can also explicitly define equality ==, and then say that a and b are identical if a == b.
- thesz 15y ago>Message passing does require a sender, a receiver, and a message. You can have those in purely functional programming. No identity needed. Would you mind show me some code in pure functional language? I mean, in Haskell or Clean. Those are pure enough.