Skip to content
Browse files

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...
1 parent 32d49f8 commit 13789b7253e7e6e84a614ca351218d90b3a12ff0 wayland committed Mar 6, 2009
Showing with 67 additions and 97 deletions.
  1. +67 −32 S32-setting-library/{Any.pod → Basics.pod}
  2. +0 −65 S32-setting-library/Scalar.pod
View
99 S32-setting-library/Any.pod → S32-setting-library/Basics.pod
@@ -3,7 +3,7 @@
=head1 Title
-DRAFT: Synopsis 32: Setting Library - Any
+DRAFT: Synopsis 32: Setting Library - Basics
=head1 Version
@@ -21,43 +21,26 @@ DRAFT: Synopsis 32: Setting Library - Any
The document is a draft.
If you read the HTML version, it is generated from the pod in the pugs
-repository under /docs/Perl6/Spec/S32-setting-library/Any.pod so edit it there in
+repository under /docs/Perl6/Spec/S32-setting-library/Basics.pod so edit it there in
the SVN repository if you would like to make changes.
-=head1 Any
+=head1 Roles
-The following are defined in the C<Any> role:
-
- role Any does Object does Pattern {
- our Bool multi sub eqv (Ordering @by, $a, $b) {...}
- our Bool multi sub eqv (Ordering $by = &infix:<eqv>, $a, $b) {...}
-
- our Bool multi method defined ( Any $self) {...}
- our Bool multi method defined ( Any $self, ::role ) {...}
+=head2 Object
- our multi method undefine( Any $self ) {...}
+The following are defined in the C<Object> role:
- our multi method clone (::T $self --> T) {...}
- our multi method clone (::T $self, *%attributes --> T) {...}
+ role Object {
+ our Bool multi method defined ($self:) {...}
+ our Bool multi method defined ($self: ::role ) {...}
- our Order multi sub cmp (Ordering @by, $a, $b) {...}
- our Order multi sub cmp (Ordering $by = &infix:<cmp>, $a, $b) {...}
-
- our Callable multi method can ($self:, Str $method) {...}
- our Bool multi method does ($self:, $type) {...}
- our Bool multi method isa ($self:, $type) {...}
- our Str multi method perl ( Object $o: ) is export {...}
- our multi method warn ( Object $o: ) is export {...}
+ our multi method undefine( $self: ) {...}
}
-=over
-
=item defined
- our Bool multi defined ( Any $thing )
- our Bool multi defined ( Any $thing, ::role )
- our Bool multi method defined ( Any $self)
- our Bool multi method defined ( Any $self, ::role )
+ our Bool multi method defined ( $self: ) is export
+ our Bool multi method defined ( $self: ::role ) is export
C<defined> returns true if the parameter has a value and that value is
not the undefined value (per C<undef>), otherwise false is returned.
@@ -87,6 +70,29 @@ In all cases, calling C<undefine> on a variable
should place the object in the same state as if it was just
declared.
+=head2 Any
+
+The following are defined in the C<Any> role:
+
+ role Any does Object does Pattern {
+ our Bool multi sub eqv (Ordering @by, $a, $b) {...}
+ our Bool multi sub eqv (Ordering $by = &infix:<eqv>, $a, $b) {...}
+
+ our multi method clone (::T $self --> T) {...}
+ our multi method clone (::T $self, *%attributes --> T) {...}
+
+ our Order multi sub cmp (Ordering @by, $a, $b) {...}
+ our Order multi sub cmp (Ordering $by = &infix:<cmp>, $a, $b) {...}
+
+ our Callable multi method can ($self:, Str $method) {...}
+ our Bool multi method does ($self:, $type) {...}
+ our Bool multi method isa ($self:, $type) {...}
+ our Str multi method perl ( Object $o: ) is export {...}
+ our multi method warn ( Object $o: ) is export {...}
+ }
+
+=over
+
=item eqv
our Bool multi sub eqv (Ordering @by, $a, $b)
@@ -160,7 +166,7 @@ C<Synopsis 16: IPC / IO / Signals> for details.
=back
-=head1 Pattern
+=head2 Pattern
role Pattern {
method ACCEPTS($self:, $other) {...}
@@ -175,10 +181,39 @@ Used in smartmatching; see S03.
Used in smartmatching; see S03.
-=head1 Additions
+=head2 Scalar
-Please post errors and feedback to perl6-language. If you are making
-a general laundry list, please separate messages by topic.
+B<API document>: L<Scalar>
+C<Scalar> provides the basic tools for operating on undifferentiated
+scalar variables. All of the following are exported by default.
+=over
+
+=item undef
+
+ constant Scalar Scalar::undef
+
+Returns the undefined scalar object. C<undef> has no value at
+all, but for historical compatibility, it will numify to C<0>
+and stringify to the empty string, potentially generating a
+warning in doing so. There are two ways to determine if a
+value equal to undef: the C<defined> function (or method) can
+be called or the C<//> (or C<orelse>) operator can be used.
+
+C<undef> is also considered to be false in a boolean context.
+Such a conversion does not generate a warning.
+
+Perl 5's unary C<undef> function is renamed C<undefine> to avoid
+confusion with the value C<undef> (which is always 0-ary now).
+
+=item VAR
+This is not really a method, but some kind of macro. See L<S12> for details.
+
+=back
+
+=head1 Additions
+
+Please post errors and feedback to perl6-language. If you are making
+a general laundry list, please separate messages by topic.
View
65 S32-setting-library/Scalar.pod
@@ -1,65 +0,0 @@
-
-=encoding utf8
-
-=head1 Title
-
-DRAFT: Synopsis 32: Setting Library - Scalar
-
-=head1 Version
-
- Author: Rod Adams <rod@rodadams.net>
- Maintainer: Larry Wall <larry@wall.org>
- Contributions: Aaron Sherman <ajs@ajs.com>
- Mark Stosberg <mark@summersault.com>
- Carl Mäsak <cmasak@gmail.com>
- Moritz Lenz <moritz@faui2k3.org>
- Tim Nelson <wayland@wayland.id.au>
- Date: 19 Mar 2009 extracted from S29-functions.pod
- Last Modified: 19 Feb 2009
- Version: 1
-
-The document is a draft.
-
-If you read the HTML version, it is generated from the pod in the pugs
-repository under /docs/Perl6/Spec/S32-setting-library/Miscellaneous-scalars.pod
-so edit it there in the SVN repository if you would like to make changes.
-
-=head1 Scalar
-
-B<API document>: L<Scalar>
-
-C<Scalar> provides the basic tools for operating on undifferentiated
-scalar variables. All of the following are exported by default.
-
-=over
-
-=item undef
-
- constant Scalar Scalar::undef
-
-Returns the undefined scalar object. C<undef> has no value at
-all, but for historical compatibility, it will numify to C<0>
-and stringify to the empty string, potentially generating a
-warning in doing so. There are two ways to determine if a
-value equal to undef: the C<defined> function (or method) can
-be called or the C<//> (or C<orelse>) operator can be used.
-
-C<undef> is also considered to be false in a boolean context.
-Such a conversion does not generate a warning.
-
-Perl 5's unary C<undef> function is renamed C<undefine> to avoid
-confusion with the value C<undef> (which is always 0-ary now).
-
-=item VAR
-
-This is not really a method, but some kind of macro. See L<S12> for details.
-
-=back
-
-=head1 Additions
-
-Please post errors and feedback to perl6-language. If you are making
-a general laundry list, please separate messages by topic.
-
-
-

0 comments on commit 13789b7

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