<rapha>
can somebody explain to me like i'm five _why_ ruby can parse `if x.include? :y` just fine, but not `if x.include? :y && y.include? :z` (i do know it works with parentheses, i'm interested in the _why_ because it looks like the '&&' would be good enough to keep it unambiguous?
<rapha>
"function application" means "executing the function"?
<rapha>
&& and || do come smack in the middle of the table
<rapha>
and what's "unary -" as opposed to "-"?
<rapha>
{} blocks are at the very end of the table, so perhaps "function application" is the very bottom?
<rapha>
leftylink: but since you immediately looked at the precedence table to try and answer the question ... that means you suspect it's by design, not by necessity?
<leftylink>
well, since it's ambiguous, that's why I expected it's necessary to look at precedence
<leftylink>
but, it didn't help
<leftylink>
either way, even a simpler thing doesn't parse
<pandabot>
stderr: -e:2: syntax error, unexpected integer literal, expecting `do' or '{' or '(' - exit 1 - https://carc.in/#/r/ds91
<rapha>
ah, yes, my example could/should have been simpler, thanks
<leftylink>
an explanation I would advise NOT to accept is: "well it's ambiguous, does `5 && p 5` mean `(5 && p) 5` or `5 && (p 5)`". I think that explanation is inadequate. there are ambiguous situations where the parser does make a decision one way or the other
ur5us has quit [Remote host closed the connection]
dionysus69 has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
nmollerup has quit [Remote host closed the connection]
nmollerup has joined #ruby
ur5us has joined #ruby
protektwar has quit [Ping timeout: 250 seconds]
perrierjouet has quit [Quit: WeeChat 3.6]
dviola has quit [Quit: WeeChat 3.6]
perrierjouet has joined #ruby
Xeago has joined #ruby
ur5us has quit [Ping timeout: 244 seconds]
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
dionysus70 is now known as dionysus69
szkl has joined #ruby
dviola has joined #ruby
skuntee4 has joined #ruby
skuntee4 has quit [Remote host closed the connection]
<rapha>
mean one :o)
<rapha>
although i feel since x 1 && x 2 results in a syntax error, it'd be consistent if that had resulted in one, too
<leftylink>
I would maybe be happier if it were as simple as saying "oh since `p 1 + 1` parses and `1 + p 1` doesn't, obviously it just means that a function call without parentheses can only be the first thing in an expression", but there would need to be some nuance as to what is meant by an expression because `1 .+ p 1` parses and does what you would expect it to do, and so does `p p p p 1`
jpn has quit [Ping timeout: 265 seconds]
mikecmpbll has joined #ruby
rhe7 has joined #ruby
rhe has quit [Ping timeout: 240 seconds]
rhe7 is now known as rhe
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
jpn has joined #ruby
dionysus69 has joined #ruby
zoknert has joined #ruby
SteveR has joined #ruby
zoknert has quit [Ping timeout: 268 seconds]
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
zoknert has joined #ruby
_root has quit [Ping timeout: 268 seconds]
Tempesta has quit [Read error: Connection reset by peer]
Tempesta has joined #ruby
Tempesta has quit [Changing host]
Tempesta has joined #ruby
Tempesta has quit [Excess Flood]
eddof13 has joined #ruby
Tempesta has joined #ruby
Tempesta has quit [Changing host]
Tempesta has joined #ruby
Tempesta has quit [Excess Flood]
Tempesta has joined #ruby
Tempesta has quit [Changing host]
Tempesta has joined #ruby
Tempesta has quit [Excess Flood]
zoknert has quit [Ping timeout: 244 seconds]
Tempesta has joined #ruby
Tempesta has quit [Changing host]
Tempesta has joined #ruby
Tempesta has quit [Excess Flood]
Tempesta has joined #ruby
Tempesta has joined #ruby
Tempesta has quit [Changing host]
Tempesta has quit [Excess Flood]
dorian_ has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]