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

From: "K.Kosako" <kosako@...>
Date: 2003-01-15 04:45:09 UTC
List: ruby-dev #19360
nobu.nakada@nifty.ne.jpさんの
<200301010055.h010tFP30971@sharui.nakada.kanuma.tochigi.jp>から
> しばらく前のruby-coreの話ですが、こういうのはどうでしょうか。
> 
>     p <<-|EOS
>       |  foo
>       |    bar
>     EOS
>     # => "  foo\n    bar\n"
> 
> つまり、<<-とterminatorの間にクォーテーション以外の記号があった場合、
> 行頭の空白とその記号までを削除します。その記号がなければエラーです。

ヒアドキュメントの中身をCopy&Pasteで持ってきた場合、
"|"を各行に挿入しなければならないのが少しだけ不満です。

行の先頭から何文字分をインデントとみなすかを、
数値で指定するのではどうでしょうか?

p <<-2EOS
    foo
      bar
EOS
--
小迫@ソフネック   渋谷区恵比寿1-15-1

In This Thread