JuanitoFatas / what-do-you-call-this-in-ruby

Solving the second hard problem in Computer Science.

Home Page:https://github.com/JuanitoFatas/what-do-you-call-this-in-ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<< could be used as heredoc.

zw963 opened this issue · comments

valid:

def test_heredoc
    <<HEREDOC
      Subscription expiring soon!
HEREDOC
end

invalid:

def test_heredoc
    <<HEREDOC
      Subscription expiring soon!
    HEREDOC
end

puts test_heredoc

valid:

def test_heredoc
    <<-HEREDOC
      Subscription expiring soon!
    HEREDOC
end

puts test_heredoc

BTW: for the integrality, why not plus sign and minus sign ??

supplement:

"#{}" in many language, e.g. lisp, bash shell, named: String interpolation

please help send pull request :)