=encoding utf8 =head1 TITLE DRAFT: Synopsis 32: Setting Library - Callable =head1 VERSION 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. =head1 Callable role Callable {...} The C role implies the ability to support C<< postcircumfix:<( )> >>. =head1 Code class Code does Callable {...} Base class for all executable objects. =over =item signature method signature( --> Signature ) =item assuming method assuming( Code $executable: *@curried_positionals, *%curried_named --> Code) C primes C<$executable>, returning a C object that, when executed, will use curried arguments as well as any additionally supplied arguments. See L. =item defined method defined( --> Bool ) For C, the C<.defined> method returns whether a body has been defined. A body consisting only of C<...>, C, or C (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. =back =head1 Block # 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 and L } =head1 Signature class Signature {...} The C class is used for function parameters, as the left-hand side of a binding, and for the argument to declarators like C. See L, L, and L =head1 Capture class Capture does Positional does Associative {...} The C class is used for the arguments of function calls and the right-hand side of a binding. See L =head1 WrapHandle class WrapHandle {...} =head1 Routine class Routine is Block { method wrap(Code $code --> WrapHandle ) {...} method unwrap(Wraphandle $original --> Routine ) {...} method name( --> Str ) {...} method multi( --> Bool ) {...} } =over =item unwrap See L. =item wrap method wrap(Code $code) {...} See L. =back =head1 Sub class Sub is Routine {...} =head1 Method class Method is Routine {...} =head1 Submethod class Submethod is Routine {...} =head1 Macro class Macro is Routine {...} =head1 AUTHORS Tim Nelson Larry Wall