DRAFT: Synopsis 32: Setting Library - Callable
Created: 26 Feb 2009
Last Modified: 5 Nov 2013 Version: 3
The document is a draft.
This document documents Code, Block, Signature, Capture, Routine, Sub, Method, Submethod, and Macro.
role Callable {...}
The Callable
role implies the ability to support postcircumfix:<( )>
.
class Code does Callable {...}
Base class for all executable objects.
method signature( --> Signature )
method assuming( Code $executable: *@curried_positionals, *%curried_named --> Code)
assuming
primes $executable
, returning a Code
object that, when executed, will use curried arguments as well as any additionally supplied arguments. See "Priming" in S06.
method defined( --> Bool )
For Code
, the .defined
method returns whether a body has been defined. A body consisting only of ...
, !!!
, or ???
(with optional message arguments) does not count as defined.
To test if a name has been declared, look up the symbol in the appropriate symbol table.
# Executable objects that have lexical scopes class Block is Code does Callable { method next() {...} method last() {...} method redo() {...} method leave() {...} method labels() {...} method as() {...} # See L<S12/Introspection> and L<S02/Value types> }
class Signature {...}
The Signature
class is used for function parameters, as the left-hand side of a binding, and for the argument to declarators like my
. See "Signature objects" in S02, "Signatures" in S06, and "Signature Introspection" in S06
class Capture does Positional does Associative {...}
The Capture
class is used for the arguments of function calls and the right-hand side of a binding. See "Lists, parameters, and Captures" in S02
class WrapHandle {...}
class Routine is Block { method wrap(Code $code --> WrapHandle ) {...} method unwrap(Wraphandle $original --> Routine ) {...} method name( --> Str ) {...} method multi( --> Bool ) {...} }
See "Wrapping" in S06.
method wrap(Code $code) {...}
See "Wrapping" in S06.
class Sub is Routine {...}
class Method is Routine {...}
class Submethod is Routine {...}
class Macro is Routine {...}
Tim Nelson <[email protected]> Larry Wall <[email protected]>[ Top ] [ Index of Synopses ]