by lignuist · 12y ago · 0 comments
You can however use any expression you want in them, and have macros read them and confirm they are correct, and do whatever you want with them. For example I do some validation on my models:
@:validate( _.length>0 && _.indexOf(' ')==-1 )
public var username:String;
As for the bigger question - they are limited in what they can add, but they have many features not in other languages, they just implement them in a syntax-heavy way on the languages that lack such features. Pattern matching is a good example [2].See http://haxe.org/documentation/introduction/language-features...
[1]: http://haxe.org/manual/lf-metadata.html [2]: http://haxe.org/manual/lf-pattern-matching.html