Skip to content
This repository
Browse code

Made Basics contain Object, Any, Pattern, and Scalar

git-svn-id: http://svn.pugscode.org/pugs@25719 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 13789b7253e7e6e84a614ca351218d90b3a12ff0 1 parent 32d49f8
wayland authored
99 S32-setting-library/Any.pod → S32-setting-library/Basics.pod
Source Rendered
@@ -3,7 +3,7 @@
3 3
4 4 =head1 Title
5 5
6   -DRAFT: Synopsis 32: Setting Library - Any
  6 +DRAFT: Synopsis 32: Setting Library - Basics
7 7
8 8 =head1 Version
9 9
@@ -21,43 +21,26 @@ DRAFT: Synopsis 32: Setting Library - Any
21 21 The document is a draft.
22 22
23 23 If you read the HTML version, it is generated from the pod in the pugs
24   -repository under /docs/Perl6/Spec/S32-setting-library/Any.pod so edit it there in
  24 +repository under /docs/Perl6/Spec/S32-setting-library/Basics.pod so edit it there in
25 25 the SVN repository if you would like to make changes.
26 26
27   -=head1 Any
  27 +=head1 Roles
28 28
29   -The following are defined in the C<Any> role:
30   -
31   - role Any does Object does Pattern {
32   - our Bool multi sub eqv (Ordering @by, $a, $b) {...}
33   - our Bool multi sub eqv (Ordering $by = &infix:<eqv>, $a, $b) {...}
34   -
35   - our Bool multi method defined ( Any $self) {...}
36   - our Bool multi method defined ( Any $self, ::role ) {...}
  29 +=head2 Object
37 30
38   - our multi method undefine( Any $self ) {...}
  31 +The following are defined in the C<Object> role:
39 32
40   - our multi method clone (::T $self --> T) {...}
41   - our multi method clone (::T $self, *%attributes --> T) {...}
  33 + role Object {
  34 + our Bool multi method defined ($self:) {...}
  35 + our Bool multi method defined ($self: ::role ) {...}
42 36
43   - our Order multi sub cmp (Ordering @by, $a, $b) {...}
44   - our Order multi sub cmp (Ordering $by = &infix:<cmp>, $a, $b) {...}
45   -
46   - our Callable multi method can ($self:, Str $method) {...}
47   - our Bool multi method does ($self:, $type) {...}
48   - our Bool multi method isa ($self:, $type) {...}
49   - our Str multi method perl ( Object $o: ) is export {...}
50   - our multi method warn ( Object $o: ) is export {...}
  37 + our multi method undefine( $self: ) {...}
51 38 }
52 39
53   -=over
54   -
55 40 =item defined
56 41
57   - our Bool multi defined ( Any $thing )
58   - our Bool multi defined ( Any $thing, ::role )
59   - our Bool multi method defined ( Any $self)
60   - our Bool multi method defined ( Any $self, ::role )
  42 + our Bool multi method defined ( $self: ) is export
  43 + our Bool multi method defined ( $self: ::role ) is export
61 44
62 45 C<defined> returns true if the parameter has a value and that value is
63 46 not the undefined value (per C<undef>), otherwise false is returned.
@@ -87,6 +70,29 @@ In all cases, calling C<undefine> on a variable
87 70 should place the object in the same state as if it was just
88 71 declared.
89 72
  73 +=head2 Any
  74 +
  75 +The following are defined in the C<Any> role:
  76 +
  77 + role Any does Object does Pattern {
  78 + our Bool multi sub eqv (Ordering @by, $a, $b) {...}
  79 + our Bool multi sub eqv (Ordering $by = &infix:<eqv>, $a, $b) {...}
  80 +
  81 + our multi method clone (::T $self --> T) {...}
  82 + our multi method clone (::T $self, *%attributes --> T) {...}
  83 +
  84 + our Order multi sub cmp (Ordering @by, $a, $b) {...}
  85 + our Order multi sub cmp (Ordering $by = &infix:<cmp>, $a, $b) {...}
  86 +
  87 + our Callable multi method can ($self:, Str $method) {...}
  88 + our Bool multi method does ($self:, $type) {...}
  89 + our Bool multi method isa ($self:, $type) {...}
  90 + our Str multi method perl ( Object $o: ) is export {...}
  91 + our multi method warn ( Object $o: ) is export {...}
  92 + }
  93 +
  94 +=over
  95 +
90 96 =item eqv
91 97
92 98 our Bool multi sub eqv (Ordering @by, $a, $b)
@@ -160,7 +166,7 @@ C<Synopsis 16: IPC / IO / Signals> for details.
160 166
161 167 =back
162 168
163   -=head1 Pattern
  169 +=head2 Pattern
164 170
165 171 role Pattern {
166 172 method ACCEPTS($self:, $other) {...}
@@ -175,10 +181,39 @@ Used in smartmatching; see S03.
175 181
176 182 Used in smartmatching; see S03.
177 183
178   -=head1 Additions
  184 +=head2 Scalar
179 185
180   -Please post errors and feedback to perl6-language. If you are making
181   -a general laundry list, please separate messages by topic.
  186 +B<API document>: L<Scalar>
182 187
  188 +C<Scalar> provides the basic tools for operating on undifferentiated
  189 +scalar variables. All of the following are exported by default.
183 190
  191 +=over
  192 +
  193 +=item undef
  194 +
  195 + constant Scalar Scalar::undef
  196 +
  197 +Returns the undefined scalar object. C<undef> has no value at
  198 +all, but for historical compatibility, it will numify to C<0>
  199 +and stringify to the empty string, potentially generating a
  200 +warning in doing so. There are two ways to determine if a
  201 +value equal to undef: the C<defined> function (or method) can
  202 +be called or the C<//> (or C<orelse>) operator can be used.
  203 +
  204 +C<undef> is also considered to be false in a boolean context.
  205 +Such a conversion does not generate a warning.
  206 +
  207 +Perl 5's unary C<undef> function is renamed C<undefine> to avoid
  208 +confusion with the value C<undef> (which is always 0-ary now).
  209 +
  210 +=item VAR
184 211
  212 +This is not really a method, but some kind of macro. See L<S12> for details.
  213 +
  214 +=back
  215 +
  216 +=head1 Additions
  217 +
  218 +Please post errors and feedback to perl6-language. If you are making
  219 +a general laundry list, please separate messages by topic.
65 S32-setting-library/Scalar.pod
Source Rendered
... ... @@ -1,65 +0,0 @@
1   -
2   -=encoding utf8
3   -
4   -=head1 Title
5   -
6   -DRAFT: Synopsis 32: Setting Library - Scalar
7   -
8   -=head1 Version
9   -
10   - Author: Rod Adams <rod@rodadams.net>
11   - Maintainer: Larry Wall <larry@wall.org>
12   - Contributions: Aaron Sherman <ajs@ajs.com>
13   - Mark Stosberg <mark@summersault.com>
14   - Carl Mäsak <cmasak@gmail.com>
15   - Moritz Lenz <moritz@faui2k3.org>
16   - Tim Nelson <wayland@wayland.id.au>
17   - Date: 19 Mar 2009 extracted from S29-functions.pod
18   - Last Modified: 19 Feb 2009
19   - Version: 1
20   -
21   -The document is a draft.
22   -
23   -If you read the HTML version, it is generated from the pod in the pugs
24   -repository under /docs/Perl6/Spec/S32-setting-library/Miscellaneous-scalars.pod
25   -so edit it there in the SVN repository if you would like to make changes.
26   -
27   -=head1 Scalar
28   -
29   -B<API document>: L<Scalar>
30   -
31   -C<Scalar> provides the basic tools for operating on undifferentiated
32   -scalar variables. All of the following are exported by default.
33   -
34   -=over
35   -
36   -=item undef
37   -
38   - constant Scalar Scalar::undef
39   -
40   -Returns the undefined scalar object. C<undef> has no value at
41   -all, but for historical compatibility, it will numify to C<0>
42   -and stringify to the empty string, potentially generating a
43   -warning in doing so. There are two ways to determine if a
44   -value equal to undef: the C<defined> function (or method) can
45   -be called or the C<//> (or C<orelse>) operator can be used.
46   -
47   -C<undef> is also considered to be false in a boolean context.
48   -Such a conversion does not generate a warning.
49   -
50   -Perl 5's unary C<undef> function is renamed C<undefine> to avoid
51   -confusion with the value C<undef> (which is always 0-ary now).
52   -
53   -=item VAR
54   -
55   -This is not really a method, but some kind of macro. See L<S12> for details.
56   -
57   -=back
58   -
59   -=head1 Additions
60   -
61   -Please post errors and feedback to perl6-language. If you are making
62   -a general laundry list, please separate messages by topic.
63   -
64   -
65   -

0 comments on commit 13789b7

Please sign in to comment.
Something went wrong with that request. Please try again.