简体   繁体   English

是什么启发了Ruby的=开始.. =结束注释块语法?

[英]What inspired Ruby's =begin .. =end comment block syntax?

I know that a lot of Ruby was inspired by Perl (eg STDIN as a global constant) or Unix shell (eg the <<END heredoc syntax). 我知道很多Ruby都受到Perl(例如STDIN作为全局常量)或Unix shell(例如<<END heredoc语法)的启发。 But I don't know where the block comment syntax comes from. 但我不知道块注释语法的来源。 The syntax: 语法:

=begin
This is a comment line
it explains that the next line of code displays 
a welcome message
=end

Where does this come from? 这是从哪里来的? My knowledge of Perl is sketchy. 我对Perl的了解很粗略。 Is it Perl? 它是Perl吗?

yes, this is Perl 是的,这是Perl

Perl uses Perl使用

=begin
This is a comment line
it explains that the next line of code displays 
a welcome message
=cut

have a look here: http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(syntax)#Comments 看看这里: http//en.wikipedia.org/wiki/Comparison_of_programming_languages_(syntax)#Comments

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM