rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

Use varialbe keys with dict{}

Open DZakh opened this issue 4 months ago • 1 comments

It would be nice to pass a variable as a dict{} key:

let loc = "BS_PRIVATE_NESTED_SOME_NONE"

let properties = dict{
  [loc]: schema,
}

DZakh avatar Aug 12 '25 06:08 DZakh

Also accessing with myDict["A"] and myDict[loc] like an array, will be more practical than Dict.get

Freddy03h avatar Nov 27 '25 16:11 Freddy03h