Scope::Escape::Sugar is a Perl module that provides specialised syntax for non-local control transfer (jumping between stack frames), mainly based on the operators in Common Lisp. The non-local control transfers behave exactly like those of Scope::Escape, which should be consulted for the semantic details. This module provides more structured facilities, which take a variety of approaches to referencing the stack frame to be transferred to.
All the keywords and functions exported by this module are lexically scoped in the importing code. That is, they are available from the point of importation up to the end of the enclosing block. This is in contrast to the more common arrangement where exports are tied to a package without regard for lexical boundaries.
SYNOPSIS
use Scope::Escape::Sugar
qw(with_escape_function with_escape_continuation);
{ with_escape_function $e; ...; $e->($r); ...; }
with_escape_function $e { ...; $e->($r); ...; }
$res = with_escape_function($e { ...; $e->($r); ...; });
{ with_escape_continuation $e; ...; $e->($r); ...; }
with_escape_continuation $e { ...; $e->($r); ...; }
$res = with_escape_continuation($e { ...; $e->($r); ...; });
use Scope::Escape::Sugar qw(block return_from);
{ block foo; ...; return_from foo $r; ...; }
block foo { ...; return_from foo $r; ...; }
$res = block(foo { ...; return_from foo $r; ...; });
use Scope::Escape::Sugar qw(catch throw);
{ catch "foo"; ...; }
catch "foo" { ...; }
$res = catch("foo" { ...; });
throw("foo", $r);
Product's homepage
Requirements:
· Perl
Download Scope::Escape::Sugar 0.000 Free
Tags: whizzy syntax , control transfer , Perl module , whizzy , syntax , control ,
, foo, $e-$r , $e-$r, foo , $e-$r, $e-$r , scopeescapesugar, $res, return_from, with_escape_continuation, block, module, catch, control, common, with_escape_function, provides, perl, throw, non-local, stack, package, exports, tied

No comments:
Post a Comment