[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02157] parse bug in 1.5

From: Mirko Nasato <mirko.nasato@...>
Date: 2000-03-26 10:29:19 UTC
List: ruby-talk #2157
Ruby 1.5 seems to have a problem when parsing methods called
with a {...} block if there is space before the opening paren.

  def greet(who="world", &how)
    print how.call, " #{who}!\n"
  end

  greet ("Matz") { "Ciao" }

    => Ciao Matz!   # ruby 1.4.3 (1999-12-08)
    => parse error  # ruby 1.5.3 (2000-03-23)

  greet () { "Hello" }

    => Hello world! # ruby 1.4.3 (1999-12-08)
    => parse error  # ruby 1.5.3 (2000-03-23)

Other forms seem to work fine, including

  greet ("Matz") do; "Ciao"; end
  greet "Matz" do; "Ciao"; end

(While

  greet "Matz" { "Ciao" }

results in a parse error with both Ruby 1.5 and 1.4.)

Regards,

-- Mirko Nasato

In This Thread

Prev Next