Project

General

Profile

Actions

Feature #5352

closed

How about using <> to represent Here Document?

Added by yimutang (Joey Zhou) about 13 years ago. Updated over 6 years ago.

Status:
Rejected
Target version:
[ruby-core:39672]

Description

"<<" 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
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0