Re: A question on AND

[email protected] (yary)
Newsgroups perl.perl6.users
Message-ID <CAG2CFAbY+g0VtE4Vw-bd=g2uLmbVAuOUf=Ue7Ohtr-T4yOyJsg@mail.gmail.com>
Most of Richard's parting suggestions I understand & agree with, but not
this: " why are you using '&&' and not 'and' "

My habit (from Perl 5 days) is to use && || for expressions, and reserve
"and" "or" for "do this if assignment/function call without parens
succeeds/fails" – is there a refinement on that distinction in Raku which I
should pay attention to?

-y


On Fri, Jun 30, 2023 at 5:40 AM Richard Hainsworth <[email protected]>
wrote:

> I tried this and it worked without any problem.
>
> Here's the whole program:
>
> use v6.d;say @*ARGS.raku;if @*ARGS.elems > 0  &&  "@*ARGS[0]".lc eq "debug"  {
>     say 'got'}
> and at the terminal:
>
> $ raku todd-test.raku debug --debug=50
> ["debug", "--debug=50"]
> got
>
>
> FWIW
> why are you quoting ARGS? The .lc coerces to string anyway.
> why are you using && and not 'and'
> why are you not using a sub MAIN with an optional --debug
> eg. sub MAIN( @args, Bool :$debug=False) {
> #stuff
> if $debug { ... }
>
>
>
> On 30/06/2023 06:06, ToddAndMargo via perl6-users wrote:
>
> if @*ARGS.elems > 0  &&  "@*ARGS[0]".lc eq "debug"  {...}
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.