Author: lwall Date: 2009-11-24 10:25:36 +0100 (Tue, 24 Nov 2009) New Revision: 29183
Modified: docs/Perl6/Spec/S02-bits.pod docs/Perl6/Spec/S04-control.pod docs/Perl6/Spec/S05-regex.pod docs/Perl6/Spec/S06-routines.pod docs/Perl6/Spec/S09-data.pod docs/Perl6/Spec/S12-objects.pod docs/Perl6/Spec/S32-setting-library/Basics.pod Log: tentatively rename Object to U, representing (among other things) Universal, Undefined, Union, and Uranium :) Modified: docs/Perl6/Spec/S02-bits.pod =================================================================== --- docs/Perl6/Spec/S02-bits.pod 2009-11-24 08:44:27 UTC (rev 29182) +++ docs/Perl6/Spec/S02-bits.pod 2009-11-24 09:25:36 UTC (rev 29183) @@ -588,7 +588,7 @@ =item * Variables with non-native types can always contain I<undefined> values, -such as C<Object>, C<Whatever> and C<Failure> objects. See S04 for more +such as C<U>, C<Whatever> and C<Failure> objects. See S04 for more about failures (i.e. unthrown exceptions): my Int $x = Int; # works @@ -1057,16 +1057,16 @@ direct construction of an exception object of some sort. (See S04 for how failures are handled.) - Object Uninitialized (derivatives serve as type objects) - Whatever Wildcard (like Object, but subject to do-what-I-mean via MMD) + U Uninitialized (derivatives serve as type objects) Failure Failure (lazy exceptions, thrown if not handled properly) Whenever you declare any kind of type, class, module, or package, you're automatically declaring a undefined prototype value with the same name, known as the I<type object>. The name itself returns that type object: - Object Perl 6 object (default block parameter type, either Any or junction) + U Perl 6 object (default block parameter type, either Any or junction) Any Perl 6 object (default routine parameter type, excludes junction) + Whatever Wildcard (like Any, but subject to do-what-I-mean via MMD) Int Any Int object Widget Any Widget object @@ -1080,7 +1080,7 @@ on the type specified by the container but continues to carry the C<Failure> role. Use C<fail> to return specific failures. Use -C<Object> for the most generic non-failure undefined value. The C<Any> +C<U> for the most generic non-failure undefined value. The C<Any> type is also undefined, but excludes C<junctions> so that autothreading may be dispatched using normal multiple dispatch rules. @@ -1200,7 +1200,7 @@ value for the C<KeyHash>, the element is deleted. If undeclared, the default default for a C<KeyHash> is 0 for numeric types, C<False> for boolean types, and the null string for string and buffer types. -A C<KeyHash> of a C<Object> type defaults to the undefined prototype +A C<KeyHash> of an object type defaults to the undefined prototype for that type. More generally, the default default is whatever defined value a C<Nil> would convert to for that value type. A C<KeyHash> of C<Scalar> deletes elements that go to either 0 or the null string. @@ -1798,7 +1798,7 @@ Assigning or binding C<Nil> to any scalar container causes the container to throw out any contents and restore itself to an uninitialized state (after which it will contain a type object -appropriate to the declared type of the container, or C<Object> +appropriate to the declared type of the container, or C<U> for untyped containers). Assigning or binding C<Nil> to any composite container (such as an @@ -3842,12 +3842,12 @@ =item * The definition of C<.Bool> for the most ancestral type (that is, the -C<Object> type) is equivalent to C<.defined>. Since type objects are -considered undefined, all type objects (including C<Object> itself) +C<U> type) is equivalent to C<.defined>. Since type objects are +considered undefined, all type objects (including C<U> itself) are false unless the type overrides the definition of C<.Bool> to include undefined values. Instantiated objects default to true unless the class overrides the definition. Note that if you could -instantiate an C<Object> it would be considered defined, and thus true. +instantiate a C<U> it would be considered defined, and thus true. (It is not clear that this is allowed, however.) =item * Modified: docs/Perl6/Spec/S04-control.pod =================================================================== --- docs/Perl6/Spec/S04-control.pod 2009-11-24 08:44:27 UTC (rev 29182) +++ docs/Perl6/Spec/S04-control.pod 2009-11-24 09:25:36 UTC (rev 29183) @@ -1119,7 +1119,7 @@ any container whose type allows the C<Failure> role to be mixed in.) The C<.handled> method returns C<False> on failures that have not been handled. It returns C<True> for handled exceptions and for -all non-C<Failure> objects. (That is, it is an C<Object> method, +all non-C<Failure> objects. (That is, it is a C<U> method, not a C<Failure> method. Only C<Failure> objects need to store the actual status however; other types just return C<True>.) @@ -1533,7 +1533,7 @@ and not care about whether the function is being called in item or list context. To return an explicit scalar undef, you can always say - return Object; + return U; Then in list context, you're returning a list of length 1, which is defined (much like in Perl 5). But generally you should be using Modified: docs/Perl6/Spec/S05-regex.pod =================================================================== --- docs/Perl6/Spec/S05-regex.pod 2009-11-24 08:44:27 UTC (rev 29182) +++ docs/Perl6/Spec/S05-regex.pod 2009-11-24 09:25:36 UTC (rev 29183) @@ -2909,8 +2909,9 @@ This means that if the second alternation matches, the C<@$/> array will contain C<('every', 'green', 'BEM', 'devours', 'faces')> rather than -C<(undef, undef, undef, undef, undef, undef, 'every', 'green', 'BEM', -'devours', 'faces')> (as the same regex would in Perl 5). +C<(U, U, U, U, U, U, 'every', 'green', 'BEM', +'devours', 'faces')> (as the same regex would in Perl 5, considering +C<U> to be the same as C<undef>). =item * Modified: docs/Perl6/Spec/S06-routines.pod =================================================================== --- docs/Perl6/Spec/S06-routines.pod 2009-11-24 08:44:27 UTC (rev 29182) +++ docs/Perl6/Spec/S06-routines.pod 2009-11-24 09:25:36 UTC (rev 29183) @@ -3114,7 +3114,7 @@ The natural way to implement autothreading for multi subs is to simply have the junctional signatures (the ones that can accept -C<Object>s or junctions as well as C<Any> parameters) match more loosely than +C<U>s or junctions as well as C<Any> parameters) match more loosely than the non-autothreading versions, and let multiple dispatch find the appropriate sub based on the signature. Those generic routines then end up redispatching to the more specific ones. Modified: docs/Perl6/Spec/S09-data.pod =================================================================== --- docs/Perl6/Spec/S09-data.pod 2009-11-24 08:44:27 UTC (rev 29182) +++ docs/Perl6/Spec/S09-data.pod 2009-11-24 09:25:36 UTC (rev 29183) @@ -257,7 +257,7 @@ =head1 Typed arrays -The type of value stored in each element of the array (normally C<Object>) +The type of value stored in each element of the array (normally C<U>) can be explicitly specified too, as an external C<of> type: my num @nums; # Each element stores a native number @@ -1070,7 +1070,7 @@ default, and the exact value that allowed the collapse to "true" is not available. A variant of that is to say that if you want autothreading of a control construct, you must assign or bind to -a non-C<Object> container before the control construct, and that +a non-C<U> container before the control construct, and that assignment or binding to any such container results in autothreading the rest of the dynamic scope. (The performance ramifications of this are not clear without further experimentation, however.) So for now, @@ -1203,7 +1203,7 @@ The standard Hash is just - my Object %hash{Str}; + my U %hash{Str}; Note that any type used as a key must be intrinsically immutable, or it has to be able to make a copy that functions as an immutable key, Modified: docs/Perl6/Spec/S12-objects.pod =================================================================== --- docs/Perl6/Spec/S12-objects.pod 2009-11-24 08:44:27 UTC (rev 29182) +++ docs/Perl6/Spec/S12-objects.pod 2009-11-24 09:25:36 UTC (rev 29183) @@ -31,12 +31,12 @@ Taken as an object, a class represents all of the possible values of its type, and the class object can thus be used as a proxy for any "real" object of that type in calculating what a generic object of -that type can do. The class object is an Object, but it is not a +that type can do. The class object is an object, but it is not a Class, because there is no mandatory Class class in Perl 6. We wish to support both class-based and prototype-based OO programming. So all metaprogramming is done through the current object's C<HOW> object, which can delegate metaprogramming to any metamodel it likes. -However, by default, objects derived from Object support a fairly +However, by default, objects derived from C<U> support a fairly standard class-based model. There are two basic class declaration syntaxes: @@ -579,7 +579,7 @@ warning to define a submethod in any class that does not inherit the corresponding method name from some base class. More importantly, this would help safeguard Liskov substitutability. (But note that the -standard C<Object> class already supplies a default C<BUILD> and C<new>.) +standard C<U> class already supplies a default C<BUILD> and C<new>.) =head1 Attributes @@ -712,7 +712,7 @@ =head1 Construction and Initialization -All classes inherit a default C<new> constructor from C<Object>. It +All classes inherit a default C<new> constructor from C<U>. It expects all arguments to be named parameters initializing attributes of the same name. You may write your own C<new> to override the default, or write constructors with any other name you like. As in Perl 5, @@ -765,7 +765,7 @@ which initializes the object in least-derived to most-derived order. C<DESTROY> and C<DESTROYALL> work the same way, only in reverse. -The default C<BUILD> and C<BUILDALL> are inherited from C<Object>, +The default C<BUILD> and C<BUILDALL> are inherited from C<U>, so you need to write initialization routines only if you wish to modify the default behavior. The C<bless> function automatically passes the appropriate argument list to the C<BUILD> of its various @@ -1818,7 +1818,7 @@ you can add more methods to them, though you have to be explicit that that is what you're doing: - augment class Object { + augment class U { method wow () { say "Wow, I'm an object." } } Modified: docs/Perl6/Spec/S32-setting-library/Basics.pod =================================================================== --- docs/Perl6/Spec/S32-setting-library/Basics.pod 2009-11-24 08:44:27 UTC (rev 29182) +++ docs/Perl6/Spec/S32-setting-library/Basics.pod 2009-11-24 09:25:36 UTC (rev 29183) @@ -90,12 +90,12 @@ XXX Copied from S02 -- should it be deleted from there? The definition of C<.Bool> for the most ancestral type (that is, the -C<Object> type) is equivalent to C<.defined>. Since type objects are -considered undefined, all type objects (including C<Object> itself) +C<U> type) is equivalent to C<.defined>. Since type objects are +considered undefined, all type objects (including C<U> itself) are false unless the type overrides the definition of C<.Bool> to include undefined values. Instantiated objects default to true unless the class overrides the definition. Note that if you could -instantiate an C<Object> it would be considered defined, and thus true. +instantiate a C<U> it would be considered defined, and thus true. (It is not clear that this is allowed, however.) =back