On 05/27/2018 04:29 AM, Brian Duggan wrote:
On Sunday, May 27, ToddAndMargo wrote:
Why do I sometime see a range written `0..1000`
and `0...1000` (three dots)?
Two dots makes a Range. Three dots is the
sequence operator -- it makes a Seq.
~ $ perl6 -e 'say (0..1000).^name'
Range
~ $ perl6 -e 'say (0...1000).^name'
Seq
Brian
Hi Brian,
`^name` is sweet. Why the caret? (I realize it won't work without it.)
$ p6 'my Int $x; say $x.^name'
Int
I don't understand the distinction between a sequence and
a range.
$ p6 'say (0..1000).pick'
783
$ p6 'say (0...1000).pick'
778
Thank you for the help!
-T