[#11357] [PATCH] an analogue of `long long' — "Nobuyoshi.Nakada" <nobu.nakada@...>

なかだです。

18 messages 2000/11/01
[#11358] Re: [PATCH] an analogue of `long long' — matz@... (Yukihiro Matsumoto) 2000/11/01

まつもと ゆきひろです

[#11364] Re: [PATCH] an analogue of `long long' — EGUCHI Osamu <eguchi@...> 2000/11/02

えぐち@エスアンドイー です。

[#11440] class Character (was: Ruby I18N) — Yasushi Shoji <yashi@...>

[ruby-dev:11428] からの続きですが、threadは切りました。

14 messages 2000/11/08
[#11442] Re: class Character (was: Ruby I18N) — TAKAHASHI Masayoshi <maki@...> 2000/11/08

高橋征義です。用語について。

[#11443] Re: class Character (was: Ruby I18N) — Yasushi Shoji <yashi@...> 2000/11/08

At Wed, 8 Nov 2000 20:44:55 +0900,

[#11520] A problem of Socket methods on Windows — OKA Toshiyuki <oka@...>

岡と申します。

22 messages 2000/11/15
[#11523] Re: A problem of Socket methods on Windows — "Nobuyoshi.Nakada" <nobu.nakada@...> 2000/11/15

なかだです。

[#11528] Re: A problem of Socket methods on Windows — matz@... (Yukihiro Matsumoto) 2000/11/15

まつもと ゆきひろです

[#11532] Re: A problem of Socket methods on Windows — "Nobuyoshi.Nakada" <nobu.nakada@...> 2000/11/15

なかだです。

[#11534] Re: A problem of Socket methods on Windows — OKA Toshiyuki <oka@...> 2000/11/15

岡です。

[#11535] Re: A problem of Socket methods on Windows — "Nobuyoshi.Nakada" <nobu.nakada@...> 2000/11/15

なかだです。

[#11538] Re: A problem of Socket methods on Windows — "Nobuyoshi.Nakada" <nobu.nakada@...> 2000/11/15

なかだです。

[#11662] IO (Re: fork problem?) — Tanaka Akira <akr@...17n.org>

In article <E140cR3-0002ls-00@ev.netlab.zetabits.co.jp>,

22 messages 2000/11/28
[#11663] Re: IO (Re: fork problem?) — matz@... (Yukihiro Matsumoto) 2000/11/28

まつもと ゆきひろです

[#11664] Re: IO (Re: fork problem?) — Tanaka Akira <akr@...17n.org> 2000/11/28

In article <E140fxW-0002u9-00@ev.netlab.zetabits.co.jp>,

[#11665] Re: IO (Re: fork problem?) — Tanaka Akira <akr@...17n.org> 2000/11/28

In article <hvor93w5wb8.fsf@coulee.m17n.org>,

[#11669] Re: IO (Re: fork problem?) — Tanaka Akira <akr@...17n.org> 2000/11/29

In article <hvoofz05uwz.fsf@coulee.m17n.org>,

[#11672] Re: IO (Re: fork problem?) — matz@... (Yukihiro Matsumoto) 2000/11/29

まつもと ゆきひろです

[#11675] Re: IO (Re: fork problem?) — Koji Arai <JCA02266@...> 2000/11/30

新井です。

[#11677] Re: IO (Re: fork problem?) — matz@... (Yukihiro Matsumoto) 2000/12/01

まつもと ゆきひろです

[ruby-dev:11458] Re: Ruby I18N

From: " たけ (tk)" <ggb03124@...>
Date: 2000-11-09 15:20:54 UTC
List: ruby-dev #11458
たけ(tk)です。

Kazuhiro NISHIYAMA さん曰く。
》これに近いのですが、Stringの中にサブクラスが
》あるのがわかりやすいと思います。

 これ美しいですね。

 しかし、次のようにやるとうまくいかないはず。String クラスのリテラルの
引数は、その時点でコンバートしたい。どうやるんでしょうか?。

	str1 = String::MyString.new( 'abc' )

 * initialize でコンバートしてはいけない。new の引数はそのまま取り込
まれる。new の引数は String::MyString にコンバートすみのものでなければな
らない。結局 str1 = 'abc'.convert_to String::MyString としたほうがよい。
となるのかな?。でも、ついうっかりやってしまいそうな気がするなぁ。

 −−

class String
  def convert_to klass
    return self if self.type == klass
    return klass.new( self + "("+self.class.name+"->"+klass.name+")"  )
  end
end

class String  
  class MyString < String
    ##def initialize s
    ##  ??
    ##end
  end
end

class String    
  class YourString < String
  end
end

##str1 = String::MyString.new( 'abc' )

str1 = 'abc'.convert_to String::MyString
str2 =  str1.convert_to String::YourString

p str1.type     	##  String::MyString
p str2.type     	##  String::YourString

p str1      ##  "abc(String->String::MyString)"
p str2      ##  "abc(String->String::MyString)(..MyString->..YourString)"

p str2.is_a? String 	##  true

たけ(tk) ggb03124@nifty.ne.jp
http://member.nifty.ne.jp/take_tk

In This Thread