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

Using simple built-in data types

Perl 6 comes with a number of various built-in types that cover the common range of things, such as Booleans, integers, and strings, but also offers unusual data types. We will cover them in this section. To demonstrate the built-in types, we will print them to the console using the say function, as we did in the ‘Hello, World!’ example.

The hierarchy is built using two types of items: roles and classes. Roles are drawn in ovals, while classes are rectangle boxes. Roles are similar to interfaces in some programming languages. In this chapter, we won't focus on the details of what is a role or a class. You can learn that in detail in Chapter 8, Object-Oriented Programming. For now, we will assume that you have some basic understanding of object-oriented programming and will be able to understand the hierarchy of the data types.

In the following sections of this chapter, we will go through the main data types that you may use in your practice.

主站蜘蛛池模板: 丰镇市| 伊川县| 咸宁市| 南涧| 新河县| 七台河市| 山西省| 彰化县| 洪湖市| 铜山县| 嵊泗县| 泊头市| 兰州市| 随州市| 林口县| 佛学| 弥渡县| 泰宁县| 海淀区| 彭山县| 新巴尔虎左旗| 怀柔区| 凤城市| 双流县| 渭南市| 富蕴县| 建平县| 开化县| 密云县| 姜堰市| 江北区| 姜堰市| 霞浦县| 北宁市| 苏尼特左旗| 吉首市| 东安县| 万载县| 保康县| 龙口市| 长葛市|