[#8257] Re: Smalltalk [Re: design patterns] — 助田 雅紀 <masaki.suketa@...>

助田です。

11 messages 1998/06/09
[#8259] Re: Smalltalk [Re: design patterns] — KIMURA Koichi <kkimura@...> 1998/06/10

[#8262] TkGrid do not exist? — Hiramatu Yoshifumi <hiramatu@...>

平松です。

26 messages 1998/06/10
[#8266] Re: TkGrid do not exist? — matz@... (Yukihiro Matsumoto) 1998/06/10

まつもと ゆきひろです

[#8269] Re: TkGrid do not exist? — NAGAI Hidetoshi <nagai@...> 1998/06/10

永井@知能.九工大です.

[#8271] Re: TkGrid do not exist? — NAGAI Hidetoshi <nagai@...> 1998/06/10

永井@知能.九工大です.

[#8375] new MethodIndex — keiju@... (Keiju ISHITSUKA)

けいじゅ@日本ラショナルソフトウェアです.

21 messages 1998/06/16
[#8447] new MethodIndex — TEI meiki <tei@...> 1998/06/20

こんにちは、鄭です。

[#8448] new MethodIndex — TEI meiki <tei@...> 1998/06/20

再び、鄭です。_o_

[#8418] how to use delegate — gotoken@... (GOTO Kentaro)

ごとけんです

18 messages 1998/06/18
[#8419] Re: how to use delegate — matz@... (Yukihiro Matsumoto) 1998/06/19

まつもと ゆきひろです

[#8420] Re: how to use delegate — gotoken@... (GOTO Kentaro) 1998/06/19

ごとけんです

[#8421] Re: how to use delegate — matz@... (Yukihiro Matsumoto) 1998/06/19

まつもと ゆきひろです

[#8521] hash sort — "Kazuhiro Yoshida" <s95l980@...>

もりきゅうです。

34 messages 1998/06/26
[#8523] hash sort — gotoken@... (GOTO Kentaro) 1998/06/26

ごとけんです

[#8533] Re: hash sort — WATANABE Hirofumi <watanabe@...> 1998/06/26

わたなべです.

[#8534] Re: hash sort — gotoken@... (GOTO Kentaro) 1998/06/26

ごとけんです

[#8536] Re: hash sort — Sinichiro Dezawa <dezawa@...> 1998/06/26

出沢です

[#8538] Re: hash sort — gotoken@... (GOTO Kentaro) 1998/06/26

ごとけんです

[#8539] Re: hash sort — TAKAHASHI Masayoshi <maki@...> 1998/06/26

高橋です。

[#8541] Re: hash sort — gotoken@... (GOTO Kentaro) 1998/06/26

ごとけんです

[#8546] Re: hash sort — Tadayoshi Funaba <tadf@...> 1998/06/26

ふなばです。

[ruby-list:8325] require

From: "Kazuhiro Yoshida" <moriq@...2.seikyou.ne.jp>
Date: 1998-06-13 19:38:13 UTC
List: ruby-list #8325
はじめまして。もりきゅう こと 吉田和弘です。
不具合っぽいことを見つけましたのでご報告します。

# nifty:FGALTS/MES/5/230 での質問と同じ内容です。

ruby のバージョンは
ruby 1.1b9_24(98/06/09) [i386-cygwin32]
です。
djgpp版 1.1b9_24 でも試しました。結果は一緒でした。


wars.rb の一部
---
field = Field.new(8,8)

for name in ARGV
  begin
    require "#{name}.rb"
    eval("#{name.capitalize}.new(field,name)")
  rescue
    print "#{name} can't come in : #$!\n"
  end
end
---

  require "#{name}.rb"
は
  require name
と書けます。

しかしこうすると
  ruby wars.rb ray rot esc
で起動した場合
  rot can't come in : undefined method `name' for #<Field:0x...>
となります。Field::name という method と解釈されているようです。

また不思議な事に
  ruby wars.rb rot esc ray
で起動した場合
  esc can't come in : undefined method `name' for #<Field:0x...>
となります。いつも2つ目のパラメータでひっかかるみたいです。

また
  require "#{name}"
でも同じ不具合が出ます。

  eval("require '#{name}'; #{name.capitalize}.new(field,name)")
こうすると問題ないです。

--
Kazuhiro Yoshida (moriq@ma2.seikyou.ne.jp)
http://www.users.yun.co.jp/~moriq/


In This Thread

Prev Next