buzz-language / buzz

👨‍🚀 buzz, A small/lightweight statically typed scripting language
https://buzz-lang.dev
MIT License
1.15k stars 31 forks source link

Tuples #298

Closed giann closed 4 weeks ago

giann commented 4 weeks ago

Syntaxic sugar over anonymous objects:

const regular = .{ name = "Joe", age 42 };

const name = "Joe";
const age = 42;
const named = .{ name, age };

const tuple = .{ "Joe", 42 };

tuple.@"0" == "Joe";
tuple.@"1" == 42;