Why are parentheses required in this?
I am looking for a purely syntax related reasoning. This is not a question about what should or not be in ruby for beauty or whatever.
not(['a','u','i','o','e'].include? s[0].downcase)
#this third line will error!
not ['a','u','i','o','e'].include? s[0].downcase
#you can also incorrectly represent this as
not['a','u','i','o','e'].include?(s[0].downcase)
#but correctly as this with the higher precedence !
!['a','u','i','o','e'].include?(s[0].downcase)
#but then again incorrectly as
!['a','u','i','o','e'].include? s[0].downcase
In general I think the whitespaces with (), {}, ;, \n, and end are oddly difficult to get correct in ruby. It has something to do with precendence. Can someone show me a mapping of where and not these invisible () are when executing the above code.