SugarCpp
SugarCpp copied to clipboard
LiveScript (array) indexing
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;
these are really nice for tuple accessors too
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)