[#19261] lstripped here-document (Re: comments and continuing strings on the next line) — nobu.nakada@...

なかだです。

29 messages 2003/01/01
[#19360] Re: lstripped here-document (Re: comments and continuing strings on the next line) — "K.Kosako" <kosako@...> 2003/01/15

nobu.nakada@nifty.ne.jpさんの

[#19361] Re: lstripped here-document (Re: comments and continuing strings on the next line) — "NAKAMURA, Hiroshi" <nakahiro@...> 2003/01/15

なひです。

[#19364] Re: lstripped here-document (Re: comments and continuing strings on the next line) — nobu.nakada@... 2003/01/17

なかだです。

[#19366] Re: lstripped here-document (Re: comments and continuing strings on the next line) — "NAKAMURA, Hiroshi" <nakahiro@...> 2003/01/17

なひです。

[#19299] [BUG] errno == 0 — Kazuhiro Yoshida <moriq@...>

もりきゅうです。win32だけかもしれません。

22 messages 2003/01/04
[#19301] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19302] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19303] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19304] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19306] Re: [BUG] errno == 0 — nobu.nakada@... 2003/01/05

なかだです。

[ruby-dev:19272] Re: ruby-1.8.0 / yield(nil)とyield()のちがい

From: Tanaka Akira <akr@...17n.org>
Date: 2003-01-01 04:23:07 UTC
List: ruby-dev #19272
In article <1041394108.920587.21729.nullmailer@picachu.netlab.jp>,
  matz@ruby-lang.org (Yukihiro Matsumoto) writes:

> これは「しょうがない」としました。これが区別できたことはない

互換性との兼ね合いで困難なのであろうことはわかります。

したがって、wrapper に |*a| を使うのは無謀なのだろう、というのが私の印
象です。そして、だからこそ、wrapper を作るときには |a| で受けるしかな
いんじゃないのか、というのが私の立場です。

> し、これからも無理でしょう。というか、これも区別したいと思っ
> ていろいろ画策しましたが、これを区別することを許すと
> 
>   *a = []
> 
> が[[]]になってしまい、互換性からも使い勝手からも望ましくない
> と思ったので。

ただ、互換性を考えなければ、個人的に想像する使い勝手としては、これが
[[]] になるのは構わないと思います。

> 意味がよくわかりませんでした。
> 
>  def f; yield *[[]]; end; f {|a| test_ok(a, [[]])}
> 
> が期待されているということ?

今回の話は、drb のような yield を転送する wrapper ですから、

server: def f() yield [[]] end
client: f {|a| ... }

とあった場合に、直接

> |> def f; yield [[]]; end; f {|a| test_ok(a, [[]])}

とするのと、[ruby-dev:19231] で推奨されている、いったん |*a| で受けて
yield *a で渡すというのに対応する

> |> def f; yield [[]]; end; f {|*a| test_ok(a, [[]])}
> |> def f; yield *[[]]; end; f {|a| test_ok(a, [])}

というので結果が異なるのは wrapper になってないからまずいだろう、とい
うことです。

つまりこれも |*a| で受けて yield *a とするのがいいだろうという話に対す
る反例の提示です。
-- 
[田中 哲][たなか あきら][Tanaka Akira]

In This Thread