[#37041] [ANN] Exerb/Exerb-CC 2.6.0 — Yuya Kato <yuya-ml@4th.to>

未踏ユース終了まで1ヶ月を切って、焦り気味のYuyaです。

27 messages 2003/02/02
[#37202] Re: [ANN] Exerb/Exerb-CC 2.6.0 — "TOYOFUKU Chikanobu" <toyofuku@...> 2003/03/02

豊福です。

[#37206] Re: [ANN] Exerb/Exerb-CC 2.6.0 — Yuya Kato <yuya-ml@4th.to> 2003/03/04

Yuyaです。

[#37058] Re: Local variables & blocks — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

27 messages 2003/02/05
[#37059] Re: Local variables & blocks — ichimal@... 2003/02/06

皆様、初めまして鈴木です。

[#37063] Re: Local variables & blocks — matz@... (Yukihiro Matsumoto) 2003/02/07

まつもと ゆきひろです

[#37110] Re: Local variables & blocks — ichimal@... 2003/02/16

鈴木です。

[#37115] Re: Local variables & blocks — Tanaka Akira <akr@...17n.org> 2003/02/17

In article <200302161629.h1GGTvJ5008901@fenix.ne.jp>,

[#37123] 私はこれにハマリました。 — Shin-ichiro HARA <sinara@...> 2003/02/18

原です。

[ruby-list:37050] Re: String#each_byte

From: Tietew <tietew-ml-ruby-list@...>
Date: 2003-02-04 04:10:42 UTC
List: ruby-list #37050
On Tue, 4 Feb 2003 11:10:25 +0900
In article <20030204110409.9E7E.GGB03124@nifty.ne.jp>
[[ruby-list:37047] String#each_byte]
Take_tk <ggb03124@nifty.ne.jp> wrote:

> 具体的には、文字列をバイト単位で each_with_index や collect を簡単に使え
> るようになるとうれしい。

こんなのを考えたことがあります。

module Enumerable
  class With
    include Enumerable
    def initialize(obj, meth)
      @obj = obj
      @meth = meth
    end
    def each(*args, &block)
      @obj.__send__ @meth, *args, &block
    end
  end
  def with(meth)
    With.new(self, meth)
  end
  def with_index
    With.new(self, :each_with_index)
  end
end

"abcde".with(:each_byte).collect # => [ ?a, ?b, ?c, ?d, ?e ]



—[ Tietew ]——————————————————————————
 メ : tietew@tietew.net / tietew@raug.net / tietew@masuclub.net
ホペ: http://www.tietew.net/     Tietew Windows Lab.
      http://www.masuclub.net/   鱒倶楽部
指紋: 26CB 71BB B595 09C4 0153  81C4 773C 963A D51B 8CAA


In This Thread