[#17615] substitution at when-clause — Takaaki Tateishi <ttate@...>

立石です.

47 messages 2002/07/01
[#17619] Re: substitution at when-clause — matz@... (Yukihiro Matsumoto) 2002/07/01

まつもと ゆきひろです

[#17621] Re: substitution at when-clause — Takaaki Tateishi <ttate@...> 2002/07/02

At Tue, 2 Jul 2002 02:54:01 +0900,

[#17622] Re: substitution at when-clause — matz@... (Yukihiro Matsumoto) 2002/07/02

まつもと ゆきひろです

[#17624] Re: substitution at when-clause — Takaaki Tateishi <ttate@...> 2002/07/02

At Tue, 2 Jul 2002 13:30:17 +0900,

[#17627] Re: substitution at when-clause — matz@... (Yukihiro Matsumoto) 2002/07/02

まつもと ゆきひろです

[#17630] Re: substitution at when-clause — Takaaki Tateishi <ttate@...> 2002/07/02

立石です.

[#17631] Re: substitution at when-clause — matz@... (Yukihiro Matsumoto) 2002/07/02

まつもと ゆきひろです

[#17635] Re: substitution at when-clause — Takaaki Tateishi <ttate@...> 2002/07/03

立石です.

[#17639] Re: substitution at when-clause — matz@... (Yukihiro Matsumoto) 2002/07/03

まつもと ゆきひろです

[#17644] Re: substitution at when-clause — keiju@... (石塚圭樹) 2002/07/03

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

[#17645] Re: substitution at when-clause — matz@... (Yukihiro Matsumoto) 2002/07/03

まつもと ゆきひろです

[#17647] Re: substitution at when-clause — keiju@... (石塚圭樹) 2002/07/03

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

[#17649] Re: substitution at when-clause — Takaaki Tateishi <ttate@...> 2002/07/03

At Wed, 3 Jul 2002 17:48:58 +0900,

[#17651] Re: substitution at when-clause — keiju@... (石塚圭樹) 2002/07/03

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

[#17730] Re: self in block — masaki <GEC01122@...>

16 messages 2002/07/20

[#17764] Re: self in block — masaki <GEC01122@...>

31 messages 2002/07/22
[#17765] Re: self in block — matz@... (Yukihiro Matsumoto) 2002/07/23

まつもと ゆきひろです

[#17768] Re: self in block — Tanaka Akira <akr@...17n.org> 2002/07/23

In article <1027383423.558649.31176.nullmailer@picachu.netlab.jp>,

[#17769] Re: self in block — matz@... (Yukihiro Matsumoto) 2002/07/23

まつもと ゆきひろです

[#17770] Re: self in block — Tanaka Akira <akr@...17n.org> 2002/07/23

In article <1027404202.545188.1283.nullmailer@picachu.netlab.jp>,

[#17771] Re: self in block — matz@... (Yukihiro Matsumoto) 2002/07/23

まつもと ゆきひろです

[#17772] Re: self in block — Tanaka Akira <akr@...17n.org> 2002/07/23

In article <1027406979.880878.1358.nullmailer@picachu.netlab.jp>,

[#17832] Re: [ruby-cvs] ruby: * random.c: replace with Mersenne Twister RNG. — nobu.nakada@...

なかだです。

17 messages 2002/07/26
[#17835] Re: [ruby-cvs] ruby: * random.c: replace with Mersenne Twister RNG. — matz@... (Yukihiro Matsumoto) 2002/07/26

まつもと ゆきひろです

[#17837] Re: [ruby-cvs] ruby: * random.c: replace with Mersenne Twister RNG. — nobu.nakada@... 2002/07/26

なかだです。

[#17842] Re: [ruby-cvs] ruby: * random.c: replace with Mersenne Twister RNG. — matz@... (Yukihiro Matsumoto) 2002/07/26

まつもと ゆきひろです

[#17886] line number(Re: Re: [ruby-cvs] ruby: * random.c: replace with Mersenne Twister RNG.) — nobu.nakada@... 2002/08/02

なかだです。

[#17893] Re: line number(Re: Re: [ruby-cvs] ruby: * random.c: replace with Mersenne Twister RNG.) — matz@... (Yukihiro Matsumoto) 2002/08/03

まつもと ゆきひろです

[#17897] Re: line number(Re: Re: [ruby-cvs] ruby: * random.c: replace with Mersenne Twister RNG.) — nobu.nakada@... 2002/08/03

なかだです。

[#17973] Re: line number(Re: Re: [ruby-cvs] ruby: * random.c: replace with Mersenne Twister RNG.) — nobu.nakada@... 2002/08/11

なかだです。

[ruby-dev:17707] Re: self in block

From: Tanaka Akira <akr@...17n.org>
Date: 2002-07-18 03:20:00 UTC
List: ruby-dev #17707
In article <20020718.115142.74757422.GEC01122@nifty.ne.jp>,
  masaki <GEC01122@nifty.ne.jp> writes:

> Fact=Sequence.new([1]){<n> n*self[n-1]}
> 
> の self が Fact を指してくれないと困ります。

define_method を使って Fact にブロックをメソッドとして植え付けてしまえ
ばいいのでは?

class Sequence
  def initialize(list=[],*parameter)
    @list=list
    @para=parameter
    class << self
      define_method(:call, lambda)
    end
  end

  def [](n)
    @list[n] || @list[n]=call(n)
  end
end

Fact=Sequence.new([1]){|n| n*self[n-1]}
-- 
[田中 哲][たなか あきら][Tanaka Akira]
「ふえろ! わかめちゃん作戦です$(C⊇」(Little Worker, 桂遊生丸)

In This Thread