NAME ^

src/builtins/control.pir - Perl 6 Control functions

Functions ^

die

exit

 multi Control::Basic::exit ( Int $status = 0)
Stops all program execution, and returns $status to the calling environment.

nothing

 multi Control::Basic::nothing ()
No operation. Literally does nothing.

sleep

 our Num multi Control::Basic::sleep ( Num $for = Inf )
Attempt to sleep for up to $for seconds. Implementations are obligated to support subsecond resolutions if that is at all possible.

[Q: what about multithreading? do we just sleep this thread? need to coordinate with entire async model. -law]

eval

 multi Control::Basic::eval ( Str $code, Grammar :$lang = CALLER::<$?PARSER>)
Execute $code as if it were code written in $lang. The default is the language in effect at the exact location of the eval call.

Returns whatever $code returns, or undef on error.

TODO: Functions ^

evalfile

 multi Control::Basic::evalfile (Str $filename : Grammar :$lang = Perl6)
Behaves like, and replaces Perl 5 do EXPR, with optional $lang support.

fail

TODO: Research the exception handling system.


parrot