tstrtabs.nim 261 B

123456789101112131415161718192021
  1. discard """
  2. targets: "c cpp js"
  3. """
  4. import std/strtabs
  5. proc fun()=
  6. let ret = newStringTable(modeCaseSensitive)
  7. ret["foo"] = "bar"
  8. doAssert $ret == "{foo: bar}"
  9. let b = ret["foo"]
  10. doAssert b == "bar"
  11. proc main()=
  12. static: fun()
  13. fun()
  14. main()