[osflash] New Language RFC

Ralf Bokelberg info at bokelberg.de
Fri Nov 4 19:14:32 EST 2005


Nemerle seems to have a nice featureset, while still looking c-like. 
What do you think about it? http://nemerle.org

Something i find particular useful is the usage of this as constructor

class MyClass {
	public this(){
		//constructor of MyClass
	}
}

This way we never run into the problem, that the constructor has a 
different name then the class.

It also seems like AS3 is heavily influenced by either Nemerle or C#, or 
it's the other way around, who knows :)

Cheers,
Ralf.




Nicolas Cannasse wrote:

>>ok i see.
>>
>>Another idea which comes to my mind:
>>What about beeing able to specify multiple types for a parameter?
> 
> 
> As you shown, multiple types require some kind of discriminating matching.
> I would prefer extend the enum's so they can take parameters :
> 
> enum AnyNumber {
>     int( Int );
>     float( Float );
> }
> 
> function plusOne( x : AnyNumber )  : AnyNumber {
>     switch x {
>     int(i) => int(i + 1);
>     float(f) => float(f + 1);
>     }
> }
> 
> This is not "true" pattern matching yet since there is no recursivity but it 
> might be already a nice this way to acheive some dynamic typing and 
> polymorphism in a safe-manner.
> 
> Nicolas
> 
> 
> _______________________________________________
> osflash mailing list
> osflash at osflash.org
> http://osflash.org/mailman/listinfo/osflash_osflash.org



More information about the osflash mailing list