Let's just say that this is why Larry is designing the language and not you or I

Understood. But I've never needed to do this in the past, (and I assume that were it a common occurance in your programming you would have produced an example), so as hard as I might try, I cannot think of a pressing use for it.

That is, any use beyond the one that is (very breifly) alluded too at the very end of Apo6:

But let and friends need to be blazing fast if we're ever going to use Perl for logic programming, or even recursive descent parsing.

Grammers are the foundation of not just p6 regexes, but at the very core of P6 itself, and (I assume) that grammers (and therefore P6) will require a RDP.

So, reading between the line, I assume that the emphasis on the speed of "hypotheticals" and with them, "temporisable" lvalue subs, is a requirement to ensure that P6 regexes and P6 compilation is fast. If this is the case, it would be nice if that was stated a little more clearly somewhere--even if just in response to questions like this.

That said--and it is only my leap of intuition at this stage--the only way I see of avoiding invoking an lvalue sub twice, whilst retaining the ability to undo lexically localised changes to it, is to actually not assign at the notional point of assignment, but rather defer the actual assignment until the end of the local scope, by proxying the value for the duration of that scope and only making the assignment at the end of the localised scope, if hypothetical is--for want of a better term--realised.

If that is how it will be done, then could not that final rvalue, be provided to the sub at that point for verification? It still comes down to understanding what action might be taken by the sub suthor in the event that rvalue fails verification. And of those actions possible, which would be the cause of an undesirable slowdown in the processing of an lvalue sub?

Like you said, it will probably need LW or TheDamian to resolve that question.


Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.

In reply to Re^9: Experimenting with Lvalue Subs by BrowserUk
in thread Experimenting with Lvalue Subs by Limbic~Region

Title:
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, details, 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, summary, 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.