5 ms·
You lost me at 'public static function main.'
by yxhuvud 14y ago
You lost me at 'public static function main.'
- boofar 14y agoFunctions are public by default. You could leave that out. The main function has to be static and will serve as the entrance point of the program, not the class. So this might just look like too much when in fact this is just a very small code sample. Did I address some of your concerns, or did I miss the point entirely? Just curious.
- jonpacker 14y agoI think his comment could be refrased as "This language looks like Java"
- clemos 14y agoWell at least it doesn't look like PHP...
- clemos 14y agoAlso, IMHO the fact that Haxe looks familiar to people coming from Javascript, ActionScript, or Java is a plus.
- WiseWeasel 14y agoAgreed. I'd wager there are substantially more people learning JavaScript these days than PHP, not that PHP looks too foreign, relatively speaking.
- clemos 14y agoActually functions are private by default. "static function main()" seems to work as an entrance point, though, which makes sense somehow...
- boofar 14y agoI'm sorry, you're correct of course! Private is the sane default obviously.
- andolanra 14y agoThey found me again at enum Cell<T> { nil; cons(car : T, cdr : Cell<T>); } class List { public static function mymap<A, B>(f : A -> B, l : Cell<A>) : Cell<B> { return switch(l) { case nil: nil; case cons(x, xs): cons(f(x), mymap(f, xs)); } } } Some of the Java heritage does seem slightly unpleasant, but interesting features like ML-style tagged enums and structural subtyping for record types mean I'm not going to discount the whole thing just yet.
- CodeMage 14y agoYeah, and those shoes totally don't match that purse! What an outrage! Seriously, if you're prepared to throw out the whole language based on what its syntax resembles, your decision-making process might need a bit of work.