deathbeam / spoon

:ramen: Spoon is a programming language that runs blazingly fast, compiles to native code and works everywhere.
https://spoonlang.org
MIT License
56 stars 11 forks source link

Add 'const' keyword #12

Closed Peekmo closed 8 years ago

Peekmo commented 8 years ago

Inexisting in haxe, I added the keyword const that is a shortcut for public static inline var.

Regards, Peekmo

deathbeam commented 8 years ago

I also wanted to add this, but I was not really sure, because we are adding more reserwed keywords.

Peekmo commented 8 years ago

const keyword is meaningfull, and it helps code clarity no?

deathbeam commented 8 years ago

Yes, but in Haxe, you can also have inline static function, not only variable.

Peekmo commented 8 years ago

In fact, but "const" concept exists in many languages, and the translation in haxe could be "public static inline var", and it would be a nice shortcut.

For inline static function, just keep things like that perhaps ? I don't really know if there's a name for this kind a functions..

Peekmo commented 8 years ago

As a side note, if you worry about reserved keywords, perhaps could we remove next do, they do not add so much readability.

deathbeam commented 8 years ago

do is for anonymous functions, and next is because of more Ruby-like syntax.

deathbeam commented 8 years ago

Not going to add const keyword to not flood the namespace.