Larry wrote:

I really prefer the form where .#() looks like a no-op method call,
and can provide the visual dot for a postfix extender.  It also is
somewhat less likely to happen by accident the #., I think.  And I
think the front-end shape of .# is more recognizable as different
from #, while #. requires a small amount of visual lookahead, and
is the same "square" shape on the front, and could easily be confused
with a normal line-ending comment.

I'm not enamoured of the .# I must confess. Nor of the #. either. I wonder whether we need the dot at all. Or, indeed, the full power of arbitrary delimiters after the octothorpe.

What if we restricted the delimiters to the five types of balanced brackets? And then simply said that, when any comment specifier (i.e. any octothorpe) is followed immediately by an opening bracket, the comment extends to the corresponding closing bracket?

Then you could have:

        #[ This is a comment ]
        #( This is a comment )
        #{ This is a comment }
        #< This is a comment >
        #« This is a comment »

That would also mean that # is *always* the comment introducer
(and the *only* comment introducer).

As for gappy dotting, that would become:

        $x#[      ].foo()
 or:

        $x.#<      >foo()

as the coder prefers.

Though, frankly, every one of the alternatives proposed so far is so ugly that I seriously doubt that anyone will actually want to use them (or maybe that's the point! ;-)

Especially when there are cleaner alternatives for aligning postfixes already standard in the language:

        @another_array[ $idx ] = $hash.{         $key };
        @other_array[   $idx ] = $other_hash.{   $key };
        @array[         $idx ] = $another_hash.{ $key };

        foo    $obj: $arg  =  $get_foo(     $arg );
        barb   $obj: $arg  =  $get_barb(    $arg );
        bazaar $obj: $arg  =  $get_bizarre( $arg );

Maybe we're trying too hard to let people have their postfix dotted space
(and eat it too).

Damian
        

Reply via email to