Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 128 lines (80 sloc) 2.733 kb
be1862e P6 Synopsis : ws changes - to help BOMers, added leading blank line to f...
Darren_Duncan authored
1
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
2 =encoding utf8
3
04840a3 [Spec] treat all authors equally
lwall authored
4 =head1 TITLE
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
5
ea5fbe1 [S32] Corrections for typos, mis-formatting, cut-and-paste errors, and o...
Util authored
6 DRAFT: Synopsis 32: Setting Library - Callable
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
7
04840a3 [Spec] treat all authors equally
lwall authored
8 =head1 AUTHORS
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
9
04840a3 [Spec] treat all authors equally
lwall authored
10 Tim Nelson <wayland@wayland.id.au>
11 Larry Wall <larry@wall.org>
12
13 =head1 VERSION
14
15 Created: 26 Feb 2009
16
17 Last Modified: 3 May 2009
18 Version: 2
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
19
20 The document is a draft.
21
cf529a7 @sorear Update provenance blurbs to point at GitHub
sorear authored
22 If you read the HTML version, it is generated from the Pod in the specs
23 repository under
24 L<https://github.com/perl6/specs/blob/master/S32-setting-library/Callable.pod>
25 so edit it there in the git repository if you would like to make changes.
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
26
9d5a38d P6 Synopsis : ws changes - remove trailing spaces
Darren_Duncan authored
27 This document documents Code, Block, Signature, Capture, Routine, Sub, Method, Submethod,
28 and Macro.
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
29
30 =head1 Roles
31
9d5a38d P6 Synopsis : ws changes - remove trailing spaces
Darren_Duncan authored
32 =head2 Callable
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
33
6e859b2 P6 Synopsis : ws changes - all tabs to spaces
Darren_Duncan authored
34 role Callable {...}
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
35
36 The C<Callable> role implies the ability
37 to support C<< postcircumfix:<( )> >>.
38
39 =head2 Code
40
6e859b2 P6 Synopsis : ws changes - all tabs to spaces
Darren_Duncan authored
41 # Base class for all executable objects
42 role Code {
43 method Signature signature() {...}
44 method Code assuming(...) {...}
45 method do() {...} # See L<S12/Introspection>
46 method Bool defined {...}
9d5a38d P6 Synopsis : ws changes - remove trailing spaces
Darren_Duncan authored
47 # XXX What does do() return? I mean, it's a "method body", but what's that?
6e859b2 P6 Synopsis : ws changes - all tabs to spaces
Darren_Duncan authored
48 }
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
49
1da2dd8 [Callable] defined defined on Code
lwall authored
50 For C<Code>, the C<.defined> method returns whether a body has
51 been defined. A body consisting only of C<...>, C<!!!>, or C<???>
52 (with optional message arguments) does not count as defined.
53
54 To test if a name has been declared, look up the symbol in the
55 appropriate symbol table.
56
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
57 =head2 Block
58
6e859b2 P6 Synopsis : ws changes - all tabs to spaces
Darren_Duncan authored
59 # Executable objects that have lexical scopes
60 role Block does Code does Callable {
61 method next() {...}
62 method last() {...}
63 method redo() {...}
64 method leave() {...}
65 method labels() {...}
66 method as() {...} # See L<S12/Introspection> and L<S02/Value types>
67 }
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
68
69 =head2 Signature
70
6e859b2 P6 Synopsis : ws changes - all tabs to spaces
Darren_Duncan authored
71 # Function parameters (left-hand side of a binding)
72 role Signature {...}
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
73
74 =head2 Capture
75
6e859b2 P6 Synopsis : ws changes - all tabs to spaces
Darren_Duncan authored
76 # Function call arguments (right-hand side of a binding)
77 role Capture does Positional does Associative {...}
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
78
bd2bd5e More masak-inspired changes.
wayland authored
79 =head2 WrapHandle
80
6e859b2 P6 Synopsis : ws changes - all tabs to spaces
Darren_Duncan authored
81 role WrapHandle {...}
bd2bd5e More masak-inspired changes.
wayland authored
82
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
83 =head1 Classes
84
85 =head2 Routine
86
6e859b2 P6 Synopsis : ws changes - all tabs to spaces
Darren_Duncan authored
87 class Routine does Block {
d802fb9 Assuming .^methods returns an array of Method objects, I'mve documented ...
wayland authored
88 method WrapHandle wrap(Code $code) {...}
89 method Routine unwrap(Wraphandle $original) {...}
90 method Str name() {...}
91 method Bool multi() {...}
92 }
bd2bd5e More masak-inspired changes.
wayland authored
93
b130c5f added missing POD commands
jimmy authored
94 =over
95
bd2bd5e More masak-inspired changes.
wayland authored
96 =item unwrap
97
9d5a38d P6 Synopsis : ws changes - remove trailing spaces
Darren_Duncan authored
98 See L<S06/Wrapping>.
bd2bd5e More masak-inspired changes.
wayland authored
99
100 =item wrap
101
102 method wrap(Code $code) {...}
103
9d5a38d P6 Synopsis : ws changes - remove trailing spaces
Darren_Duncan authored
104 See L<S06/Wrapping>.
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
105
b130c5f added missing POD commands
jimmy authored
106 =back
107
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
108 =head2 Sub
109
6e859b2 P6 Synopsis : ws changes - all tabs to spaces
Darren_Duncan authored
110 class Sub isa Routine {...}
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
111
112 =head2 Method
113
6e859b2 P6 Synopsis : ws changes - all tabs to spaces
Darren_Duncan authored
114 class Method isa Routine {...}
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
115
116 =head2 Submethod
117
6e859b2 P6 Synopsis : ws changes - all tabs to spaces
Darren_Duncan authored
118 class Submethod isa Routine {...} # XXX or should this be isa Sub
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
119
120 =head2 Macro
121
6e859b2 P6 Synopsis : ws changes - all tabs to spaces
Darren_Duncan authored
122 class Macro isa Routine {...}
726d70f Lots more stuff in S32. Documented Callable objects, and extended Conta...
wayland authored
123
124 =head1 Additions
125
126 Please post errors and feedback to perl6-language. If you are making
127 a general laundry list, please separate messages by topic.
Something went wrong with that request. Please try again.