Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Pure OO vs. Curried Syntax

Name: Anonymous 2010-08-07 23:18

So /prog/, I have looked around and I haven't been able to find any more-or-less pure OO languages with curried syntax. What gives?

It's not uncommon to see: object message message message

Where object message returns an object which accepts takes the next message, but what if the message is a method call that takes parameters? Instead of returning a curried object, you still get: object method(a,b) method(x,y), but never: object method a b method x y -- why is that?

Name: Anonymous 2010-08-10 14:36

>>39
The OCaml examples don't immediately help because it should all be implicit. I didn't really make this clear, and I guess I should have.
No, you did, but it was the closest analogue I could find.

On the other hand: (bar#make_added 4 3)#get;; is not bad, but too bad about the parens.
The other parens are unnecessary in Ocaml, but it was put there to get the *exact* same behaviour as if they were curried, in normal code you would do (bar #make_added 4 3) #get ;;. Maybe you could convince the Ocaml guys to give a "currying mode"? I notice that the other functional + oo languages like F# and Scala don't provide the behaviour you want either.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List