What does the tree method do in Perl6?
From Perl6 Documentation
Returns a class if it is undefined, or if it does not repeat, the result of applying the method treeto elements, if it is, is returned Iterable.
However, there is no description of the tree method in the "iterable" documentation.
I tried:
my $a = 1..4;
say $a.tree;
And received:
$ perl6 test.pl6
(1 2 3 4)
Unlike attempts:
my $a = 1..4;
say $a;
And having received:
$ perl6 test.pl6
1..4
But I'm not quite sure what the difference is or what it means.
In the type list on the Perl6 document website, there does not seem to be a separate tree type.
source
share