[Sorry, sent this to the wrong list by mistake.]

Matthew Zimmerman wrote:
Juerd wrote:

Kurt skribis 2005-06-20 19:46 (-0400):

On 6/20/05, Juerd wrote:

Or you can just get your "self" with a simple (module that does)
   macro self () { '$?SELF' }


And you could do the same for `./`.



Certainly.

However, there has proven to be much demand for something like ./method,
and in such cases, having it by default is probably the best thing.

I personally don't think it's either necessary or too much. I care about
.method using $_, and many other people care about having short syntax
for self.method too. ./method was something that would work for me, so I
shared that idea, and it was generally accepted.

Apart from the personal joy of seeing something I invented become part
of the official language, I don't really care if ./method is eventually
part of Perl 6 or not. I have always named my invocants, and don't mind
continue to do so. On the other hand, if there is a shorthand, I will
use it, because regardless of whether you think it's pretty or ugly, and
regardless of whether you think it looks enough like a method call,
having a short two character operator for this is in fact very
convenient.


Could we revisit the idea of using a shorter keyword for $?SELF, like 'o'? I know that $Larry said the idea was "probably" not going to work:

  http://tinyurl.com/7baz6

but I'm curious if the reasoning that killed it then still holds now, now that './' has emerged as a replacement.

Count me among the './' dissenters, too. The virtual explosion of new operators in Perl 6 has not concerned me too much, as I don't envision myself using many of them, but the operation that './' does is something I do very frequently. I'm just imaging a lot of my Perl 5 code like:

   if ( $self->unit_id == $s2->unit_id ) {
        $self->add_component(
                         $self->_fraction * $self->concentration +
                             $s2->_fraction * $s2->concentration
                        );
        $self->update;
   }

replaced with:

   if ( $.unit_id = $s2.unit_id ) {
        ./add_component(
                        ./:fraction * ./concentration +
                        $s2.:fraction * $s2.concentration
                       );
        ./update;
   }

and it gives me the willies. If I have a complicated mathematical expression with method calls in it (which happens a lot for me), the '/' part of './' in particular gives me lots of visual problems.

I'll put

   macro o () { '$?SELF' }

at the top of my code if I have to, but I want to make one last gasp at getting $Larry / @Larry to reconsider this.



--
      Matt

      Matthew Zimmerman
      Interdisciplinary Biophysics, University of Virginia
      http://www.people.virginia.edu/~mdz4c/

Reply via email to