On Tue, Jun 13, 2017 at 9:33 PM, Elizabeth Mattijsen wrote:
>> On Tue, Jun 13, 2017 at 8:50 PM, Elizabeth Mattijsen wrote:
On 13 Jun 2017, at 19:34, Gabor Szabo wrote:
I just managed to write
while True {
...
> On Tue, Jun 13, 2017 at 8:50 PM, Elizabeth Mattijsen wrote:
>>> On 13 Jun 2017, at 19:34, Gabor Szabo wrote:
>>>
>>> I just managed to write
>>>
>>> while True {
>>> ...
>>> break if $code eq 'exit';
>>> ...
>>> }
>>>
>>>
>>> I wonder if Rakudo
On Tue, Jun 13, 2017 at 8:50 PM, Elizabeth Mattijsen wrote:
>
>> On 13 Jun 2017, at 19:34, Gabor Szabo wrote:
>>
>> I just managed to write
>>
>> while True {
>>...
>>break if $code eq 'exit';
>>...
>> }
>>
>>
>> I wonder if Rakudo could be more
I just managed to write
while True {
...
break if $code eq 'exit';
...
}
I wonder if Rakudo could be more cleaver in this particular case and
remind me to use 'last' instead of 'break'.
Gabor
Yup, you can use it as a method call like this:
perl6 -e '"foobar".&[~~](/foo/).say'
「foo」
HTH
- Timo