[ruby-list:49] ruby 0.96 or 1.0alpha

From: matz@... (Yukihiro Matsumoto)
Date: 1996-01-08 05:58:18 UTC
List: ruby-list #49
まつもと ゆきひろ@トヨタケーラムです.

今年もよろしく.

もうすぐrubyの次のリリースを出そうと思います.

チュートリアルを書いている途中で見付けたバグ取りが主です.
でもって,この辺で1.0にあげようと思います.

おまけ:

チュートリアルでも使っているrubyのlistenerです.シェルのよう
に1行読み込んでは実行するものです.rubyには(まだ)デバッガが
ないので,ちょっと実行してみたい時とかに便利かも知れません.

0.95c以降で無いとまともに動かなかったような気がします.

line = ''
indent=0
print "ruby> "
while TRUE
  l = gets
  if not l
    break if line == ''
  else
    line = line + l 
    if l =~ /,\s*$/
      print "ruby| "
      continue
    end
    if l =~ /^\s*(class|module|def|if|case|while|for|begin)\b[^_]/
      indent += 1
    end
    if l =~ /^\s*end\b[^_]/
      indent -= 1
    end
    if indent > 0
      print "ruby| "
      continue
    end
  end
  begin
    print eval(line).inspect, "\n"
  rescue
    $! = 'exception raised' if not $!
    print "ERR: ", $!, "\n"
  end
  break if not l
  line = ''
  print "ruby> "
end
print "\n"

In This Thread

Prev Next