Andy Wingo <[email protected]> writes: > Hi :) > > On Fri 10 Mar 2017 16:31, David Kastrup <[email protected]> writes: > >> a) Guile already uses two different internal representations: basically >> UCS-8 and UCS-32. Adding more internal representations could be done >> using a number of tables indexed by the internal representation type, >> making string representations sort of a "plugin". > > I think we probably want to avoid this if we can. We gain a number of > efficiencies if we can be concrete.
Maybe use GOOPS on the string ops by diversifying on string subtypes? One would start by making UCS-32 and UCS-8 string implementations subtypes of strings, then add UTF-8-internal (which is identical to UTF-8 for all-valid UTF-8)? I doubt that this would beat a vector of dedicated hooks but it might look more transparent to implementors with special needs? Maybe not: they might not approach this from a Guile angle of thinking. -- David Kastrup
