in reply to Re: white spaces between the sigil and the variable ( $ x = )
in thread white spaces between the sigil and the variable ( $ x = )

(who is "our" Abigail as well)

Alas, not any more, since some years now. - But it must be him; his main objection to Perl 6 is significant whitespace, and I'm with him on that one. I detest python for it's significant whitespace (or abuse of indentation) - python scripts look like full of dangling code to me - and I love the whitespace liberty of perl 5 which lets me align code vertically, like in

$foo {three} = $doit -> (1 ); $quux {two} = get_that (25);

which improves readability, imho.

Replies are listed 'Best First'.
Re^3: white spaces between the sigil and the variable ( $ x = )
by massa (Hermit) on Oct 27, 2008 at 01:27 UTC
    In Perl6, you don't have to give your aligning up...
    $foo. <<three>> = $doit. (1); $quux. <<two> = get_that(25);
    ... or something :-)
    []s, HTH, Massa (κς,πμ,πλ)
Re^3: white spaces between the sigil and the variable ( $ x = )
by BrowserUk (Patriarch) on Oct 27, 2008 at 02:28 UTC
    $foo{ three } = $doit->( 1 ); $quux{ two } = get_that( 25 );

    There. All better now :) (And (probably?) compatible with Perl 6)

    My justifictions:

    1. $foo  {three} looks like the scalar $foo juxtaposed against a bare-block containing a bareword.

      Conversely, this $foo{ says, hash; and this $foo{ three } is clearly addressing the element keyed with three in the hash named %foo.

    2. Ditto $quux {two}
    3. $doit -> (1 ); looks like the scalar $foo fired an arrow at a big-bottomed girl's left butt-cheek.

      Conversely, this $doit->(   1 ) obviously dereferences the scalar $doit and attempts to call it as a subroutine passing 1 as the parameter.

    4. get_that (25) reads like an extract from a foriegn correspondant's newspaper article: "The bride, get_that (25), was resplendent in her gown of layered white taffeta..."

      Whereas this get_that( 25 ); is obviously calling a subroutine.

      Though if you're using a small enough font, that silly underscore seems to disappear, and suddenly it turns into Patrick McGoohan giving an order to that bit-part cast member you knew was destined to die this episode, because of his identifier.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      $foo{ three } = $doit->( 1 ); $quux{ two } = get_that( 25 );
      There. All better now :) (And (probably?) compatible with Perl 6)
      I think it fails in at least three ways:
      1. When accessing a hash element, the sigil in Perl6 is %, not $.
      2. The autoquoting shortcut has been replaced with a construct that requires as many keystrokes as using quotes. I'm not quite sure what %foo{three} does in Perl6, but I think it's the same as %foo{three()}. The Perl5 equivalent of $foo{three} is %foo{'three'} or %foo<<three>>. The latter can also be written using some Latin-1/Unicode character, but I can't be bothered to look up its code. It's a character that isn't on a standard US keyboard. But someone out there who held on to his APL keyboard will be very happy with Perl6.
      3. The arrow is gone. Perl bows its head to Java, and uses a dot. So it's $doit.(1). Or maybe &doit.(1), just as one uses % to access a hash element.

        I meant whitespace-wise. That you don't have to give up (subjectively) good formatting, because Perl 6 doesn't allow spaces between the identifier and the open paren/curly/bracket.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
      $foo{ three } = $doit->( 1 ); $quux{ two } = get_that( 25 );

      There. All better now :) (And (probably?) compatible with Perl 6)

      I personally believe that it strongly depends on how you're interpreting "compatible:" in fact the new dereferencer is a single dot and not an arrow any more - something that as far as I'm concerned (FWIW) seems reasonable and desirable 95% of the times and will make me regret the arrow the remaining 5% - but then think of the usefulness and clarity of dereferencing the implicit topicalizer (which is $_ as usual) and how ugly that would be if an arrow were to be used instead! Oh, and again I for one cherish the arrow now used for pointy subs, but that's mainly in connection with an RPL thingie that's very personal and possibly uninteresting to annoying for others so that I'm not repeating it here once more...

      --
      If you can't understand the incipit, then please check the IPB Campaign.
Re^3: white spaces between the sigil and the variable ( $ x = )
by blazar (Canon) on Oct 27, 2008 at 23:18 UTC
    (who is "our" Abigail as well)

    Alas, not any more, since some years now. - But it must be him; his main objection to Perl 6 is significant whitespace, and I'm with him on that one.

    I personally believe that it was clear enough I was using "our" (in quotes, in fact) in the Pooh sense: indeed it used to be him, then he had an idiosyncrasy with the environment here, and voting and the like; he's definitely a clpmisc-kinda-guy. As you can clearly understand, he's rather radical in his choices and judgements - this whitespace thingie included. In fact Perl 6 is admittedly more whitespace sensitive than Perl 5, but... not that much! To even remotely mention Python (which has indentation as part of the syntax!) in these respects sounds mostly like a heresy to me!

    Anyway tastes are tastes and Abigail is to say the least an extremely resourceful and skilled Perl hacker far above the top of my head, but as a general rule he found Perl 6's design to be too clean and neat, while he cherishes the "medieval-castle-like characteristics" of Perl 5. A matter we may discuss for hours without getting anything out of it if we have contrasting opinions...

    --
    If you can't understand the incipit, then please check the IPB Campaign.