[#37875] ERB の仕様 — URABE Shyouhei <s-urabe@...>

みなさまはじめまして。

44 messages 2003/07/15
[#37876] Re: ERB の仕様 — Masatoshi SEKI <m_seki@...> 2003/07/15

咳といいます。

[#37877] Re: ERB の仕様 — URABE Shyouhei <s-urabe@...> 2003/07/15

mput です。

[#37879] Re: ERB の仕様 — m_seki@... 2003/07/15

[#37883] Re: ERB の仕様 — URABE Shyouhei <s-urabe@...> 2003/07/16

mput です。

[#37884] Re: ERB の仕様 — m_seki@... 2003/07/16

[#37888] Re: ERB の仕様 — URABE Shyouhei <s-urabe@...> 2003/07/16

mput です。

[#37889] Re: ERB の仕様 — m_seki@... 2003/07/16

[#37890] Re: ERB の仕様 — URABE Shyouhei <s-urabe@...> 2003/07/17

mput です。

[#37891] Re: ERB の仕様 — MoonWolf <moonwolf@...> 2003/07/19

MoonWolfです。

[#37896] Re: ERB の仕様 — MoonWolf <moonwolf@...> 2003/07/20

MoonWolfです。

[#37898] Re: ERB の仕様 — Masatoshi SEKI <m_seki@...> 2003/07/20

咳といいます。

[#37900] Re: ERB の仕様 — MoonWolf <moonwolf@...> 2003/07/20

MoonWolfです。

[#37901] Re: ERB の仕様 — Masatoshi SEKI <m_seki@...> 2003/07/20

咳といいます。

[#37906] control user ID / group ID — Hidetoshi NAGAI <nagai@...>

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

20 messages 2003/07/20
[#37912] Re: control user ID / group ID — YOKOYAMA Takehiro <tac@...> 2003/07/21

[#37913] Re: control user ID / group ID — Hidetoshi NAGAI <nagai@...> 2003/07/21

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

[#37916] Re: control user ID / group ID — YOKOYAMA Takehiro <tac@...> 2003/07/21

[#37941] multipart/form-dataのためのcgi.rbの修正 — 堀川 久 <vzw00011@...>

こんにちは。

18 messages 2003/07/22
[#37944] Re: multipart/form-dataのためのcgi.rbの修正 — matz@... (Yukihiro Matsumoto) 2003/07/23

まつもと ゆきひろです

[#37945] Re: multipart/form-dataのためのcgi.rbの修正 — nobu.nakada@... 2003/07/23

なかだです。

[#37948] Re: multipart/form-dataのためのcgi.rbの修正 — matz@... (Yukihiro Matsumoto) 2003/07/23

まつもと ゆきひろです

[#37951] Re: multipart/form-dataのためのcgi.rbの修正 — nobu.nakada@... 2003/07/23

なかだです。

[#37953] Re: multipart/form-dataのためのcgi.rbの修正 — matz@... (Yukihiro Matsumoto) 2003/07/23

まつもと ゆきひろです

[#37954] Re: multipart/form-dataのためのcgi.rbの修正 — nobu.nakada@... 2003/07/23

なかだです。

[ruby-list:37961] Re: "".split level

From: Kazuhiro Yoshida <moriq@...>
Date: 2003-07-23 10:33:54 UTC
List: ruby-list #37961
もりきゅうです。
むしろ
p "".split(/\t/,1) # [""]
がおかしくて [] になるべき…

matz@ruby-lang.org (Yukihiro Matsumoto) wrote:
> 結果を見るとむしろ
> 
>   ruby -e '"".split("\t", 1)
> 
> が[""]を返す方が変で、Perlとの類推から考えるとこれも[]になる
> べきではないかと考えます。

ですか。

Perlで書いてみた:
D:\usr\moriq>type split0.pl
use strict;
#print "<", ((defined "")?"T":"F"), ">\n";
#print "<", ((defined undef)?"T":"F"), ">\n";
sub str_inspect {
        my ($str) = @_;
        (defined $str)?qq{"$str"}:"nil";
}
sub strp {
        my ($str) = @_;
        print str_inspect($str), "\n";
}
sub aryp {
        print "[", join(', ', map {str_inspect $_} @_), "]\n";
}
#aryp ("a",undef,"b");
#aryp ("a","b",undef);
sub test {
        my ($str) = @_;
        print "--- str=";
        strp $str;
                aryp split(/x/, $str);
                my $t = sub {
                        my ($limit) = @_;
                        aryp split(/x/, $str, $limit);
                };
        $t->(0);
        $t->(1);
        $t->(2);
        $t->(3);
        $t->(-1);
}
test("");
test("x");
test("axbxc");

D:\usr\moriq>perl split0.pl
--- str=""
[]
[]
[]
[]
[]
[]
--- str="x"
[]
[]
["x"]
["", ""]
["", ""]
["", ""]
--- str="axbxc"
["a", "b", "c"]
["a", "b", "c"]
["axbxc"]
["a", "bxc"]
["a", "b", "c"]
["a", "b", "c"]

D:\usr\moriq>perl -v

This is perl, v5.8.0 built for MSWin32-x86-multi-thread
...

D:\usr\moriq>type split0.rb
def test(str)
  print "--- str="
  p str
  p str.split(/x/)
  t = proc {|limit| p str.split(/x/,limit) }
  t.call(0)
  t.call(1)
  t.call(2)
  t.call(3)
  t.call(-1)
end
test("")
test("x")
test("axbxc")

D:\usr\moriq>d:\usr\bin\ruby split0.rb
--- str=""
[]
[]
[""]
[]
[]
[]
--- str="x"
[]
[]
["x"]
["", ""]
["", ""]
["", ""]
--- str="axbxc"
["a", "b", "c"]
["a", "b", "c"]
["axbxc"]
["a", "bxc"]
["a", "b", "c"]
["a", "b", "c"]

D:\usr\moriq>d:\usr\bin\ruby -v
ruby 1.8.0 (2003-06-23) [i386-mswin32]

----
YOSHIDA Kazuhiro  moriq@moriq.com  http://www.moriq.com/

In This Thread

Prev Next