|
 |
Darren New <dne### [at] san rr com> wrote:
> Warp wrote:
> > Basically, it seems, that instead of having to write, for example,
> > "someFunction(anObject)" you can write "anObject.someFunction()".
> Syntax sugar. And let lets you do things like
> "Hello".toUpper().myConversion().trim("o")
> so you can chain them together.
> The same benefit you get in C++ from being able to make classes with no
> virtual members. You often talk about how you can have an array of points
> in C++ without any extra overhead and still treat them like objects, yes?
> Same sort of thing here.
I'm not sure it's the same thing.
The idea with having objects rather than raw data is that objects can
be made abstract, ie. have an abstract public interface which hides the
implementation).
I don't see how "anObject.someFunction()" hides the implementation
better than "someFunction(anObject)", especially given that the former
does not add any access rights for the function in question (like
declaring a function as friend would).
--
- Warp
Post a reply to this message
|
 |