pyret-lang
pyret-lang copied to clipboard
`string-dict` `.add` should show dictionary extension
All the examples in the docs
https://pyret.org/docs/latest/string-dict.html#%28part.string-dict.String.Dict_string-dict_set%29
only show updates to existing fields, misleading readers into thinking you can't use this to extend a dictionary. A test like this can help:
check:
s1 = [string-dict: ]
s2 = s1.set("Hello", "World")
s2.get("Hello") is some("World")
end
Thanks to Sam Weiss (CSCI 0190) for pointing this out!