in reply to Re: Re^3: Get rid of the Indirect Syntax, please!
in thread On the Improvement of Exegesis 12

Plus, do you really want close $*OUT:; all over your code, just to avoid $*OUT.close;?

Nope, but then again I don't because Larry tells us:

The colon may be omitted if there are no arguments (besides the invocant):

Y'know it's almost like somebody spent a lot of time thinking all of this through :-)

  • Comment on Re^5: Get rid of the Indirect Syntax, please!

Replies are listed 'Best First'.
Re: Re^5: Get rid of the Indirect Syntax, please!
by dragonchild (Archbishop) on Apr 19, 2004 at 13:04 UTC
    This may be a question for TimToady, but why would it be omittable in the single-argument (and possibly others) case, but not in all cases? What's the counter-example, given the really nice dispatcher and multisubs?

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

      why would it be omittable in the single-argument (and possibly others) case, but not in all cases?

      Again - I've only skimmed A12 so I am probably wrong :-) However, consider:

      bar $foo, 1;

      Does this mean:

      ($foo.bar), 1

      or:

      $foo.bar( 1 );

      The colon disambiguates it:

      bar $foo: 1 == $foo.bar( 1 ); bar $foo, 1 == ($foo.bar), 1;
        If you're writing that, you're crazy. But, if you wanted to do that, then you are probably going to have written some crazy multimethod signature which will disambiguate. And, if the parser can't deal with it, your maintainer sure as heck won't be able to deal with it.

        The colon disambiguates it:

        And, to this statement, I can only say "Parentheses should be disambiguating it". If you're depending on a colon, which is on the same key as the semi-colon (the most-used character in C-type languages, I might add) ... I have the same feeling about this as I do about an organization who knows its database schema is bad, but refuses to stop new development. *shrugs*

        ------
        We are the carpenters and bricklayers of the Information Age.

        Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose