On Wed, Oct 1, 2008 at 1:29 PM, James Gray <james / grayproductions.net> wrote:
> On Oct 1, 2008, at 1:15 PM, Jim Freeze wrote:
>
> It's interesting to hear the reasoning, but I'm not buying it.  :)
>
> Most of Ruby is vulnerable to this issue and we don't seem to need weird
> syntaxes for all of those cases.  Right?
>
> Other ways to concatenate Ruby Strings:
>
>  "#{'a'}#{'bc'}"  # cannot be overridden
>
>  'a'.dup.concat('bc')
>
>  'a'.dup << 'bc'
>
>  'a'.sub(/\z/, 'bc')
>
> I'm not arguing that these are great strategies of course.  I just think we
> can manage to get by without it.  :)

The use case that Matz presented on years ago was when you have a long string
and want to break it across lines. Under those circumstances, you
really want some
type of lexical (is that the right word here) addition is not part of
the language but
part of the preprocesser. Since Ruby doesn't really have that, your
only option would
be something like

  x = "Lorem ipsum dolor sit amet, consectetur " \
        "adipisicing elit, sed do eiusmod tempor" \
        "...."



-- 
Jim Freeze