On Thu, Mar 28, 2013 at 11:27 AM, Vincent Stowbunenko
<lists / ruby-forum.com> 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.

>
> Is there a way to fix this?  Thanks.
>
> Attachments:
> http://www.ruby-forum.com/attachment/8275/bottlesofbeer2.rb