SugarCpp icon indicating copy to clipboard operation
SugarCpp copied to clipboard

LiveScript (array) indexing

Open ozra opened this issue 11 years ago • 2 comments

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;

ozra avatar Dec 08 '14 11:12 ozra

these are really nice for tuple accessors too

dobkeratops avatar Dec 08 '14 15:12 dobkeratops

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)

ozra avatar Dec 08 '14 21:12 ozra