curimit / SugarCpp

SugarCpp is a language which can compile to C++11.
136 stars 13 forks source link

LiveScript (array) indexing #35

Open ozra opened 9 years ago

ozra commented 9 years ago

The alternative list indexing syntax in LS is concise and clear imo - the dot, hinting downwards, sort of gives the feeling of mathematical notation subscript.

some-array.0 = some-array.1 + 47

-->

some_array[0] = some_array[1] + 47;
dobkeratops commented 9 years ago

these are really nice for tuple accessors too

ozra commented 9 years ago

Definitely! Tuples implement the [] operator right? If so, case closed :) (In this case of using C++ as target-"assembly"-language instead of say LLVM-IR)