in reply to Re: Re (9): Perl6 headaches?
in thread Perl6 headaches?

Why would I rather use dots? Because I came to Perl from C++ (believe it or not) where the "->" is used to access members and methods of a pointer to an object; the "." is used when you have the object itself. So when I came to Perl, and eventually used references, the arrow notation sort of made sense, since references are kinda like pointers. And the same goes for objects... but, wait... objects are references, so does that make them like pointers or objects?

I understand why Perl had to use something other than "." since it differentiated between string addition and numeric addition. However, every other language found some way to use "." for objects. Why not Perl? And it has. I like this new approach, because it is consistent with the approach taken by many other languages. And I like that idea. That is why I am in favor of it.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re (tilly) 12: Perl6 headaches?
by tilly (Archbishop) on Nov 05, 2001 at 12:52 UTC
    I find the arrow perfectly consistent with its use in C and C++. You use an arrow when you access things through a reference. A dot when you access things directly. But in Perl you never really have an object, you have a reference to it and access it through that reference, which matches the notation.

    For instance if you make a copy of an object, and adjust that copy, the original changes. If you make a copy of an object and rebless it, the original is now in a different class. Those internal details show that any and all accesses to the object are taking place through a level of dereferencing. If the data was immediate then modifying a copy wouldn't change the other copies. But it isn't immediate and so changes are shared among all references to that object.

    That said, Perl 6 is doing a lot to reduce how much the programmer needs to think about explicitly dereferencing data structures. Therefore it makes sense to me to have the arrow change to a dot to indicate the fact that we are supposed to stop thinking so much about dereferencing...