Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: perl5 vs perl6

by blazar (Canon)
on Jan 06, 2005 at 18:42 UTC ( [id://420021]=note: print w/replies, xml ) Need Help??


in reply to Re: perl5 vs perl6
in thread perl5 vs perl6

Continuations. While most solutions won't need these, those that do need them.
Well, since you brought up continuations, another item I feel like adding to my randomly selected list amongst the many randomly selectable ones is 'hypotheticals'. Perl6-ese for local is temp, so far nothing new. But there will be let as well, and it will behave like temp except that the value of the variable at the exit of scope will be retained or discarded in favour of the previous one according a condition. I'm not really sure about the exact syntax/semantics, sounds interesting though!!
Perl will compile to Parrot opcodes.

That last is the most important item. This means that any two languages that compile to Parrot will be able to use each other's code seamlessly.

Not only!! It seems that Parrot will indeed be able to run natively bytecode for other virtual machines (this is rumored to be a side effect of the planned compatibility with a game-oriented VM).

Replies are listed 'Best First'.
Re^3: perl5 vs perl6
by duff (Parson) on Jan 06, 2005 at 21:46 UTC

    let is like temp but it's only useful inside of rules. If the rule succeeds, then the variable keeps the hypothesized value. If the rule fails, then the variable loses its hypothesized value and thus reverts back to whatever value it had before (if any).

    This is all as far as I know anyway. But then, things I thought I knew about rules have changed at least 2 times since I learned them, so who really knows anyway? ;-)

      let is like temp but it's only useful inside of rules. If the rule succeeds, then the variable keeps the hypothesized value. If the rule fails, then the variable loses its hypothesized value and thus reverts back to whatever value it had before (if any).
      I've quickly searched around and indeed it seems to be so. That is, let is to be used in closures embedded in rules.

      Due to the deep analogy between rules and subs I wonder wether the same mechanism could be made to work also for the latter ones (using the return value for success): I do not see any immediate use, but I bet someone could find one.

      Well, however this is probably not best discussed here...

        Sigh. A let may certainly be used in ordinary blocks. See http://dev.perl.org/perl6/synopsis/S04.html for the definition of successful exit. The KEEP and UNDO blocks use the same definition, and are arguably part of the same underlying mechanism. You can view a let as a temp that merely does UNDO instead of LEAVE.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://420021]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (1)
As of 2024-04-25 00:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found