Skip to content

HTTPS clone URL

Subversion checkout URL

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