[nim-dev] Re: Immutable String Type Vs. Shallow/Freeze Procedure

  • From: Varriount <clay.sweetser@xxxxxxxxx>
  • To: nim-dev@xxxxxxxxxxxxx
  • Date: Sat, 21 Nov 2015 19:01:02 +0000

For anyone who's interested, I've written up a (highly experimental!) immutable
string data type
`here<https://gist.github.com/Varriount/fd56b757c6de57ab9712>`_.

The data type roughly follows the semantics of Python's ``string`` data type,
with the exception that it appears mutable (eg, the '&=' operator is
supported). Please note that slice and substring operations still make copies -
I couldn't implement non-copying behavior and still maintain implementation
simplicity.


Other related posts: