kyleect / locks

A toy language branched from Lox to learn language implementation and tooling. Forked from loxcraft
https://kyleect.github.io/locks/#/docs
MIT License
0 stars 0 forks source link

Record/Map #20

Open kyleect opened 8 months ago

kyleect commented 8 months ago
var colors = #<String, Int>{
  "red" = 0,
  "blue" = 1,
};

print typeof(colors["red"]); // out: Int | Nil
print colors["red"]; // out: 0

var bools= #<Boolean, Int>{
  true = 1
};

print typeof(bools[true]); // out: Int | Nil
print bools[true]; // out: 1
print bools[false]; // out: Nil