Issue #5352 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned
Assignee set to matz (Yukihiro Matsumoto)


----------------------------------------
Feature #5352: How about using <> to represent Here Document?
https://bugs.ruby-lang.org/issues/5352#change-25215

Author: yimutang (Joey Zhou)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: 
Target version: 


"<<" is a frequently used method in text manipulation. Meanwhile, it's also the beginning token of a here-document.
 Sometimes it may be confusing to newbies.

Unlike Perl, in which "<>" is a very very frequently used operator to read lines from a filehandle, in Ruby, "<>" has no meaning. So I think it can be used to represent Here Document, so as to reduce the possibility of misunderstanding method "<<" and here-document token "<<". And In my opinion, <> is more clear than <<, because it looks like kind of brackets.

For example,

  str = <SECT1>.upcase + <SECT2>.downcase
  aaaaaa
  SECT1
  XXXXXX
  SECT2

may be clearer than:

  str = <<SECT1.upcase + <<SECT2.downcase




-- 
http://bugs.ruby-lang.org/