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

Complex conditions with pattern matching

As shown in the previous recipe, pattern matching is very useful with enums. However, there is more! Pattern matching is a construct that originates in functional languages and curtails much of the choice between conditional branches and the assignment of properties in struct that commonly follows. These steps are taken at once, reducing the amount of code on the screen and creating something akin to a higher-order switch-case statement. 

主站蜘蛛池模板: 金堂县| 大兴区| 比如县| 平昌县| 安西县| 木兰县| 德令哈市| 岳普湖县| 信丰县| 五华县| 瑞安市| 二连浩特市| 文成县| 法库县| 双柏县| 林口县| 南陵县| 和顺县| 隆尧县| 辽中县| 游戏| 仁化县| 旬邑县| 龙井市| 娱乐| 故城县| 广德县| 井陉县| 宝清县| 德州市| 海丰县| 闸北区| 郸城县| 乐陵市| 威海市| 临桂县| 彭泽县| 彭山县| 江西省| 安庆市| 墨脱县|