Scope::Escape::Sugar

Whizzy syntax for non-local control transfer
Download

Scope::Escape::Sugar Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Andrew Main
  • Publisher web site:
  • http://search.cpan.org/~zefram/

Scope::Escape::Sugar Tags


Scope::Escape::Sugar Description

Whizzy syntax for non-local control transfer 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); Requirements: · Perl


Scope::Escape::Sugar Related Software