[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Namestring&pathstring returning shared structure
CLU solved this problem by making STRING a different type than ARRAY of
CHARACTER, and by making STRINGs immutable. We found having immutable STRINGs
to be extremely useful: one can pass a string to a procedure or return it from
a procedure without worrying that someone might destructively modify it! This
idea was such a win that a later revision of CLU had both immutable and
mutable arrays and immutable and mutable records.
It must be a bitch to write an editor in CLU, or do you just implement
lines as arrays of characters instead of as strings, thereby losing the
textual benefit of debugging and having to write separate output
routines to display these "strings"?
Actually, the Ted editor (written in CLU) did use strings to represent lines
of text. I believe using immutable strings is not uncommon, as it allows an
EQ-test in display update.