Ruby-dev summary 19198-19345

sir Nobu [mailto:nobu.nokada@softhome.net] explained:

s1 = <<|EOS
>#{hi}
I do not have the indenter
> how are you?
me, too… but ruby takes care of me :slight_smile:
EOS

Well, I don’t like it very much… it may mislead me sometimes.

You are correct. I chose worst scenario sample. I was thinking that the “|”
character (or whatever we choose) is optional in purpose so that the ff are
possible:

#this is normal
s1 = <<EOS
#{hi}
I do not have the indenter
fine
me, too… but ruby takes care of me :slight_smile:
EOS

#though indenter is specified, it should not err even if not used
s1 = <<|EOS
#{hi}
I do not have the indenter
fine
me, too… but ruby takes care of me :slight_smile:
EOS

#this one used indenter fully
s1 = <<|EOS
> #{hi}
> I do have the indenter
> fine
> me, too… and ruby takes care of me :slight_smile:
EOS

#this one combines use (since you may or may not use indenter)
s1 = <<|EOS
>================================
> #{hi}
> I have to indent this line
> And also this list line
> to make it look good
>================================
#{verylongstring} whose length I do not know/care
Lots of lines
follow here
and here… blahblah blah
I don’t mind… works all the time
EOS

Is this possible?


Nobu Nakada

kind regards -botp

Hi,

#this one combines use (since you may or may not use indenter)
s1 = <<|EOS
>================================
> #{hi}
> I have to indent this line
> And also this list line
> to make it look good
>================================
#{verylongstring} whose length I do not know/care
Lots of lines
follow here
and here… blahblah blah
I don’t mind… works all the time
EOS

Is this possible?

What possiblity? Yes for implementation, but I’m not sure
about the possiblity of adoption.

I thought concatenated 2 literals, but noticed here-doc wasn’t
allowed after here-doc. This sample works as you expected but
looks strange a bit.

s1 = <<-EOS "
>================================
> #{hi}
> I have to indent this line
> And also this list line
> to make it look good
>================================
EOS
#{verylongstring} whose length I do not know/care
Lots of lines
follow here
and here… blahblah blah
I don’t mind… works all the time
"

···

At Fri, 17 Jan 2003 10:01:56 +0900, Peña, Botp wrote:


Nobu Nakada