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...
In reply to Re^4: perl5 vs perl6
by blazar
in thread perl5 vs perl6
by jbrugger
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |