#x27;
>>> ===SORRY!=== Error while compiling -e
>>> Whitespace required before <= operator
>>> at -e:1
>>> --> say 1, 1, * + * ...^ *<= 100;⏏
>>> expecting any of:
>>> postfix
>>>
>>> and
>>> $
...^ * <= 100;'
>> ()
>> $ raku -e 'say 1, 1, * + * ...^ * >= 100;'
>> (1 1 2 3 5 8 13 21 34 55 89)
>>
>> So, then it dawned on me that the '>=' is "binding" (right word?) to the
>> "*" marking the end of the se
; "*" marking the end of the sequence as "until I am ge 100". Though that
> doesn't quite work,
> $ raku -e 'say 1, 1, * + * ...^ * <= 100;'
> ()
>
> Ah, I see, it does work. The end of the sequence is the first number less
> than 100, so 1 su
100, so 1 succeeds. I guess the sequence never gets started.
____________
From: yary
Sent: Tuesday, August 24, 2021 8:39 PM
To: William Michels
Cc: Marc Chantreux ; raku-users
Subject: Re: [better solution] pairs of separators from a string
CAUTION - EXTERNAL:
Hi Bill,
Wh
Hi Bill,
When building a range that's an arithmetic or geometric progression, the
sequence operator is a little quicker to type. And thus also more likely to
be understood more quickly too.
> ('a' .. 'h')[(0..*-1).grep: * %% 2 ]
(a c e g)
> ('a' .. 'h')[ 0, 2 ... * ]
(a c e g)
> ('a' .. 'h')[(0.
Hi Marc,
My understanding is that ranges are pretty cheap to construct, and in any
case, the range @x[0..*-1] is just the index of all elements in @x. The
.grep() approach may be most useful if you have a function (e.g. %, %%, and
.is-prime shown below):
> (0...9)
(0 1 2 3 4 5 6 7 8 9)
> (0...9)[
hello everyone,
I made a mistake while replying to all of us so anwsers never reached
your boxes. I'll summerize in one answer:
Bill:
> Is it just even/odd elements that you want to separate out? If so, maybe
> .grep() is your friend here
I don't think it is: 0, 2 ... * seems to be
* closer to