Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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