@@ -88,15 +88,15 @@ Defined as:
88
88
multi method list(Any:D \SELF: --> List)
89
89
90
90
91
- Applies the infix L « C < , > |/routine/,»
92
- operator to the invocant
93
- and returns the resulting L < List > :
91
+ Applies the infix L « C < , > |/routine/,» operator to the invocant and returns
92
+ the resulting L < List > :
94
93
95
94
say 42.list.^name; # OUTPUT: «List»
96
95
say 42.list.elems; # OUTPUT: «1»
97
96
98
- Subclasses of C < Any > may choose to return any L < Positional > type
99
- from L « C < .list > |/routine/list>» . Use L « C < .List > |/routine/List> to
97
+ Subclasses of C < Any > may choose to return any I < core > type that
98
+ does the L < Positional > role
99
+ from L « C < .list > |/routine/list» . Use L « C < .List > |/routine/List» to
100
100
coerce specifically to L < List > .
101
101
102
102
= head2 method push
@@ -377,15 +377,13 @@ Defined as:
377
377
multi method hash(Any:U: --> Hash:D)
378
378
multi method hash(Any:D: --> Hash:D)
379
379
380
- Coerces a type object to an empty L < Hash > .
380
+ When called on a type object, returns an empty L < Hash > . On instances,
381
+ equivalent to assigning the the invocant to a C < %- > sigilled variable and
382
+ returning that.
381
383
382
- More generally, coerces a defined invocant to something that supports the
383
- L < Associative > role. This may be a mutable L < Hash > , but may also be
384
- an immutable L < Map > or anything else that supports the L < Associative >
385
- role. Use the C < .Hash > method if you really want to have a mutable L < Hash > ,
386
- or the C < .Map > coercer if you're happy enough with an immutable L < Map > .
387
- Use the C < .hash > coercer if you really don't care and want the cheapest
388
- way to get an object that does the L < Associative > role.
384
+ Subclasses of C < Any > may choose to return any I < core > type that does the
385
+ L < Associative > role from L « C < .hash > |/routine/hash» . Use L « C < .Hash > |/routine/Hash» to
386
+ coerce specifically to L < Hash > .
389
387
390
388
= begin code
391
389
my $d; # $d is Any
0 commit comments