Author: jnthn Date: 2009-05-22 23:59:49 +0200 (Fri, 22 May 2009) New Revision: 26912
Modified: docs/Perl6/Spec/S12-objects.pod Log: [spec] We now always require the candidate to be passed to bless, otherwise there's potential for confusion with the first auto-vivifying type object. Modified: docs/Perl6/Spec/S12-objects.pod =================================================================== --- docs/Perl6/Spec/S12-objects.pod 2009-05-22 14:47:04 UTC (rev 26911) +++ docs/Perl6/Spec/S12-objects.pod 2009-05-22 21:59:49 UTC (rev 26912) @@ -12,8 +12,8 @@ Maintainer: Larry Wall <la...@wall.org> Date: 27 Oct 2004 - Last Modified: 4 May 2009 - Version: 82 + Last Modified: 22 May 2009 + Version: 83 =head1 Overview @@ -682,15 +682,18 @@ $object = $class.bless({k1 => $v1, k2 => $v2, ...}); -If the candidate is omitted, a candidate object is implicitly created in -the current class by calling C<CREATE>: +However, the normal way to create a candidate to bless is by calling +C<CREATE>: - $object = $class.bless(k1 => $v1, k2 => $v2, ...) - $object = $class.bless(:k1($v1), :k2($v2), ...) # same + $object = $class.bless($class.CREATE(), k1 => $v1, k2 => $v2, ...) + $object = $class.bless($class.CREATE(), :k1($v1), :k2($v2), ...) # same -(The default C<CREATE> makes an opaque object.) +Alternatively, you can pass C<Whatever> and have C<bless> call CREATE +for you. -In addition to the candidate position argument, C<bless> also + $object = $class.bless(*, k1 => $v1, k2 => $v2, ...) + +In addition to the candidate positional argument, C<bless> also allows one or more positional arguments representing autovivifying type objects. Such an object looks like a type name followed by a hash subscript (see "Autovivifying objects" below). These are used