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

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. 

主站蜘蛛池模板: 中阳县| 分宜县| 寿光市| 周宁县| 拜城县| 兴国县| 英吉沙县| 花垣县| 曲沃县| 建瓯市| 静宁县| 舒兰市| 通海县| 北碚区| 石渠县| 平安县| 志丹县| 堆龙德庆县| 凌海市| 新巴尔虎右旗| 黄石市| 香格里拉县| 英吉沙县| 顺义区| 巴彦县| 黄大仙区| 台山市| 县级市| 公安县| 饶阳县| 沧源| 扶风县| 霍邱县| 南召县| 西充县| 大同县| 遂川县| 新龙县| 遵化市| 黄石市| 攀枝花市|