def call_block
yield 'hello', 99
end
call_block {|strVar, numVar| puts strVar+numVar.to_s}
The output is: hello99
However when I use the below syntax for the yield line, it fails with an "unexpected end of input" error
yield ('hello', 99)
Naturally, a search will show many examples where yield is used with parens. Since yield is a method, I
should be able to call it with parameters using parens or not using parens. Why is the second version failing?
--
You received this message because you are subscribed to the Google Groups "Emerald City" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlrug-emeraldc...@googlegroups.com.
To post to this group, send email to atlrug-em...@googlegroups.com.
Visit this group at http://groups.google.com/group/atlrug-emeraldcity.
For more options, visit https://groups.google.com/groups/opt_out.