Skip to content

Commit c9b99f3

Browse files
committed
Avoid .WHAT where possible, use name instead
... But, because WhateverCode's ^name is funky, show .WHAT after showing the funky name result.
1 parent 2b770d5 commit c9b99f3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/Type/Range.pod6

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ Beware that a L<WhateverCode|/type/WhateverCode> end point, instead of a plain
5252
Whatever, will go through the range operator and create another WhateverCode
5353
which returns a Range:
5454
55-
=for code
55+
=for code :ok-test<WHAT>
5656
# A Whatever produces the 1..Inf range
57-
say (1..*).WHAT; # OUTPUT: «(Range)␤»
57+
say (1..*).^name; # OUTPUT: «Range␤»
5858
say (1..*); # OUTPUT: «1..Inf␤»
5959
# Upper end point is now a WhateverCode
60+
say (1..*+20).^name; # OUTPUT: «{ ... }␤»
6061
say (1..*+20).WHAT; # OUTPUT: «(WhateverCode)␤»
6162
say (1..*+20).(22); # OUTPUT: «1..42␤»
6263

0 commit comments

Comments
 (0)