官术网_书友最值得收藏!

  • Perl 6 Deep Dive
  • Andrew Shitov
  • 175字
  • 2021-07-03 00:05:46

Comments

In Chapter 1, What is Perl 6?, we've seen two ways of writing programs—by passing it in the -e command-line option or by saving it in a file. Of course, all big programs are stored in files. In this section, we will see how Perl 6 helps the programmer to organize the code better by adding comments.

Comments are parts of the source code, which are ignored by the compiler. Comments are intended to give additional information about the program itself. Good examples of comments are explanations of the algorithms used, or the purpose of variables, or a description of the input arguments of a function.

Perl 6 offers two ways of saving additional human-oriented information in the source code by using comments and the so-called Pod. First, we will examine the comments.

Comments are fragments of source code that a compiler does not consider as direct instructions for execution. In Perl 6, there are three ways of leaving comments:

  • One-line comments,
  • Multiline comments,
  • Embedded comments.

Let's examine them in detail.

主站蜘蛛池模板: 巩留县| 靖远县| 静安区| 华池县| 承德县| 北安市| 鹤岗市| 南昌县| 武城县| 长乐市| 宜春市| 泌阳县| 招远市| 枣庄市| 武川县| 昌吉市| 雅安市| 鲁山县| 莱阳市| 宁海县| 临海市| 峨眉山市| 和平县| 吕梁市| 工布江达县| 黎城县| 巴青县| 莲花县| 吉木萨尔县| 资中县| 浮梁县| 广河县| 巩义市| 铜川市| 崇明县| 海丰县| 项城市| 嘉峪关市| 佛山市| 沙湾县| 乌拉特中旗|