in reply to Re^6: howto parse (or determining end) of a line of perl
in thread howto parse (or determining end) of a line of perl

Example, one feature my calc has, is I can say a=2*pi*1 and for the LHS assign (_only_, right now), the sigil isn't needed ... See, there's that word "simple" again

And how much complexity is required to allow you the "simplicity" of omitting one character under some circumstances?

If you find typing sigils so onerous, I have a suggestion for you: http://www.scilab.org/


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
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". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^7: howto parse (or determining end) of a line of perl

Replies are listed 'Best First'.
Re^8: howto parse (or determining end) of a line of perl
by perl-diddler (Chaplain) on Aug 26, 2016 at 14:25 UTC
    Sigils onerous? How about 'unnecessary'? Most languages don't need them. But more to the point, when's the last time you saw calculators using sigils.

    As for how much complexity: 1 line:

    if (/^\w/) { /^\w+=/ and $_='$'.$_ }
    Perl could go, *mostly*, sigil-free if it wanted and remain 100% compat w/previous progs.

    I.e. it would still accept sigils, but for vars w/o sigils -- they would be allowed if predeclared and perl would use the predeclared type. If there was ever a case where more than 1 type was declared for 1 name, then a sigil would be required to differentiate them when using one of them. But in most cases where the same name isn't used w/multiple types, perl would already know the intended type as stated in the declaration.

    Would likely reduce perl's "line noise" reputation and should be 100% compat w/old code (as old code has to have sigils in place, and when in place, then no predeclared-type-default would be used.

      Would likely reduce perl's "line noise" reputation

      You say that like it would be a good thing.

        "You say that like it would be a good thing."

        I can't tell if you are intending 'irony' or not.

        Generally, line-noise is considered to be a bad thing as it impairs or prevents getting across the "signal" and hinders understanding the content.

        Usually, perl's "line noise" reputation is considered "bad" by those who use it to describe Perl code's look.

        A measure of language power is the ability to express, clearly, complex concepts in a minimum of space. One example within perl, now, is the general advice to eliminate superfluous parentheses.

        In regards to Perl code, if the type of a variable is already known, then it seems that adding a sigil would be redundant.

        Are you saying such redundancy is a good thing? If so, could you explain why?