HaxeFoundation / haxe.org-comments

Repository to collect comments of our haxe.org websites
2 stars 2 forks source link

[code.haxe.org] Beginner - Pattern matching #121

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Pattern matching - Beginner - Haxe programming language cookbook

This article helps to learn pattern matching and all of its type of matching in practice. The article covers basic matching, variable capture, guards, extractors and enum/structure matching.

https://code.haxe.org/category/beginner/pattern-matching.html

ccpplinux commented 1 year ago

In the first example of Enum matching, I am getting error message "Expected }" in the line "enum GameEvent {". What could be problem?

JonasSonn commented 1 year ago

@ccpplinux Sounds like you accidentally have put the enum declaration inside the class.

as this example