[#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:19363] Re: lstripped here-document (Re: comments and continuing strings on the next line)

From: "K.Kosako" <kosako@...>
Date: 2003-01-15 06:56:04 UTC
List: ruby-dev #19363
hmoritaさんの<20030115152950p+wE%M@ohmsha.co.jp>から
> こういうのはどうでしょうか?
> 
> p <<EOS.gsub(/^ {2}/,'')
>     foo
>       bar
> EOS
> 
> #=> "  foo\n    bar\n"

なるほど。気付いていませんでした。

式展開の結果も置き換えられる可能性があるのが、
若干気にはなりますが。

x = "a\n  b"
p <<EOS.gsub(/^ {2}/,'')
    foo #{x}
      bar
EOS
# => "  foo a\nb\n    bar\n"

>(個人的には、既存の機能で簡単に済ませられるものは、言語自体
> がサポートしていなくてもよいように感じます。)

それはそうですね。やっぱり必要ないか。
--
小迫@ソフネック   渋谷区恵比寿1-15-1

In This Thread