At 4/10/14 10:41 AM, GeoKureli wrote: switches without breaks, what if several groups of values have the same outcome?
I don't quite understand. The breaks are implied, if you wan't the same effect as a fall-through switch case:
switch(value)
{
case c1, c2:
trace("Matched");
}
Std.is (vehicle, Car)
why not just make a it a damn operator?
Yeah, I find it strange it's not an infix operator.
var car:Car = cast vehicle;
why change it at all.
I'd much a C-like cast
(Car) vehicle;
public var x (get, set):Float;
function get_x ():Float { return _x; }
function set_x (value:Float):Float { return _x = value; }
I'm half for this and half against it, but why the underscore in the function name?
Do they have to have the underscore? I'm really not sure, I tend to just write my own getter and setter which aren't actual proper ones (I'm such a bad programmer).
basically, if ou have the ability to change AS3 to look like this, why not just make it look like C#?
Good points:
function hello (msg:String):Void {}
var type:String->Void = hello;
that's just genius! maybe even better than C# delegates.
Someone correct me if I'm wrong, but is this functions being "first-class citizens"? Anyway, agreed, it's nice. The functional programming module I took actually might help me with something after all!
I heard Haxe has some crazy for loop style inline array declaration, so I can create a for loop with ordered multiples of 2 up to 100. is that a thing?
I know you can do that with lists in Python, but I've not tried or seen it done in haXe.