On 05/05/2018 02:59 AM, Elizabeth Mattijsen wrote:

On 5 May 2018, at 10:59, ToddAndMargo <toddandma...@zoho.com> wrote:
I am looking at:
https://docs.perl6.org/language/operators#infix_&&;

I understand what a Boolean AND is, but why are
they using the term "Tight"?    What am I missing?

Precedence is what you’re missing.

$ 6 'say 0 || 42 or 666'
WARNINGS for -e:
Useless use of constant integer 666 in sink context (line 1)
42

Why is that?  Because the “||" is tighter than the “or”.  So the above is 
equivalent to:

$ 6 ‘(say 0 || 42) or 666'
WARNINGS for -e:
Useless use of constant integer 666 in sink context (line 1)
42

and then it should be clear why it is warning about the 666, because that is 
now used in sink context.  For the “say” that is ok, but not for the constant.

$ 6 ‘666'
WARNINGS for -e:
Useless use of constant integer 666 in sink context (line 1)


Hope this made sense to you


Hi Elizabeth,

I get it now.  It is the P6's form of algebraic operation:
who takes precedence over whom.

so "&&" takes precedence over "and".

Thank you!

-T

"Tight".  Chuckle.  Someone had fun with that one.
Probably the same guy that came up with "slurp" and
"spurt", both of which I can't do without!

Reply via email to