Re: ./method
by Jonathan Scott Duff other posts by this author
Jun 21 2005 8:00AM messages near this date
Re: ./method
|
Re: ./method
On Mon, Jun 20, 2005 at 07:34:57PM -0400, Kurt wrote:
> On 6/18/05, Juerd wrote:
> > Why exactly is the slash not acceptable for you? Almost everyone has
> > said they like it. I personally find ./method prettier and easier to
> > type than any of the alternatives.
>
> I don't like it because I think method calls should look like method calls,
> and the slash separating the dot and name makes it look like something else
> entirely.
>
> On 6/19/05, Juerd wrote:
> > David Storrs skribis 2005-06-19 13:45 (-0400):
> > > All that said, I still agree with John... './' does not look like
> > > method call syntax to me.
> >
> > That's good, because it's different from all other method syntax anyway,
> > because it does not have any left hand side -- not even implied.
>
> I don't think it's good. A method call should look like a method call.
What are the salient characteristics of "looks like a method call"?
Is it "no intervening characters between the . and the name of the
method"?
> Frankly, I don't understand the objection to using a keyword for $?SELF,
> such as `self`.
Um ... isn't $?SELF a "keyword"? :-)
> Most other object-oriented languages use such a keyword, if
> not exactly the same one, so it will be a familiar concept. Certainly more
> readily understood for a newcomer than `./method`.
I think the difference in how readily understood it is will be
infinitesimally small. What's confusing about "./method is shorthand
for $?SELF.method"?
> As a bonus, `self` is
> easily searchable within the documentation, whereas `./` is not.
I'll grant you that. But, as punctuation rich as perl is, we should
provide a tool (p6doc?) to help with the searching and encourage
people to use it.
> I missed responding to the thread the last time this subject came up, but
> the more I see this syntax the less I like it, so I wanted to add another
> voice to the dissention. However, if it remains official, I expect I'll
> simply be naming my invocants, as chromatic has suggested.
I expect that soon after perl6 is released (heck, maybe before it's
released) we'll get tools that will translate perl6 to perl6 while
performing some syntactic manipulation. For instance, it could
"explicitize" code (replacing ./method with $?SELf.method and .foo
with $_.foo and so on)
-Scott
--
Jonathan Scott Duff
duff@pobox.com
Thread:
Gaal Yahas
Luke Palmer
John Siracusa
Damian Conway
John Siracusa
David Storrs
Matthew Zimmerman
Juerd
Matthew Zimmerman
Damian Conway
David Storrs
Juerd
Kurt
Jonathan Scott Duff
Juerd
Juerd
Kurt
Juerd
John Siracusa
John Siracusa
Adam Kennedy
Juerd
John Siracusa
Adam Kennedy
John Siracusa
Darren Duncan
John Siracusa
Juerd
Juerd
Darren Duncan
John Siracusa
John Siracusa
John Siracusa
Damian Conway
Abhijit Mahabal
Damian Conway
Patrick R. Michaud
John Siracusa
Larry Wall
Gaal Yahas
Damian Conway
Patrick R. Michaud
Damian Conway
Patrick R. Michaud
Larry Wall
Patrick R. Michaud
"TSa (Thomas Sandlaß)"
Larry Wall
|