vzmind
1
I tried to run this program (see attached) and got this following error:
…rb:42: syntax error, unexpected ‘.’, expecting ‘|’
callcc { |song.wall| song.of(99) }.sing { |beer| beer.drink }
^
…rb:42: syntax error, unexpected ‘}’, expecting $end
callcc { |song.wall| song.of(99) }.sing { |beer| beer.drink }
^
Is there a way to fix this? Thanks.
vzmind
2
On Thu, Mar 28, 2013 at 11:27 AM, Vincent S.
[email protected] wrote:
I tried to run this program and got this sollowing error:
…rb:42: syntax error, unexpected ‘.’, expecting ‘|’
callcc { |song.wall| song.of(99) }.sing { |beer| beer.drink }
^
You can’t use a method call within the vertical bars (pipes); it has
to be the name of a variable which is local to the block.
…rb:42: syntax error, unexpected ‘}’, expecting $end
callcc { |song.wall| song.of(99) }.sing { |beer| beer.drink }
^
I’m not sure about this error, but it’s probably a continuation of the
previous one.