Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

As you indicate, you're throwing away the possibility of value validation.

As I indicate, Attribute::Property takes that argument away. You may not like that it is implemented as an attribute, but never did I say that lvalues imply throwing away the possibility of value validation. If anything, I said that it used to be harder without A::P. As with any lvalue in Perl: you can validate it as long as you don't fear tie. For $foo this hasn't been a problem, but for $object->foo some people do object.

package main; { my $foo; sub foo { if (@_) { my $new = shift; # validate return $foo = $value; } return $foo } }
I have yet to see code like this. And fortunately so.

Saying that you can use attributes to get value validation back doesn't comfort me.

If this is indeed because of CHECK, I'll be happy to add another module, one that does the same thing without attribute syntax1. Attribute syntax isn't needed, it's just very nice syntactic sugar that doesn't require a source filter. But for some reason, I do not think this is the real reason for you not to use this lvalue properties.

I hope that you just object to tie, or to anything that disagrees with perldoc, or to "experimental" features, because Perl 6 will assume you want lvalue accessors.

I really like Ruby's compromise.

So do I.

However in Perl I'll continue to use rvalue accessors, thankyouverymuch.

Don't let my advocacy for laziness stop you.

Juerd # { site => '', plp_site => '', do_not_use => 'spamtrap' }

(Update) 1 Of course, the lvalue attribute is still needed. I'm assuming, but not entirely sure, that they're not handled at CHECK time.

In reply to Re^3: Use method/function signatures with Perl by Juerd
in thread Use method/function signatures with Perl by Ovid

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [Corion]: Yay. I've now published (at $work) that random Excel workbook where on one sheet you enter your SQL and on the other sheet, you have a button and receive the results. I'm so evil in enabling cow-orkers to self-supply ;)
    [Corion]: It's close to my Perl script where you paste in the SQL and get the result as XLSX file, but I guess the Excel sheet is more user-friendly :)
    [choroba]: What drivers does it support? ;-)
    [erix]: sounds cool -- but now you have to give SQL lessons?

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (9)
    As of 2018-07-18 13:02 GMT
    Find Nodes?
      Voting Booth?
      It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

      Results (392 votes). Check out past polls.