[M3devel] text inefficiency? good mutable string type? arrays?

Tony Hosking hosking at cs.purdue.edu
Tue Feb 26 23:14:37 CET 2008


Legal depends on context, as you note.  If you are able to see the  
representation of a given text then you can mess with it accordingly.   
The pointers for these are not to readonly memory.  Note that you  
probably will break things if you try to write to TextLiteral.T.buf,  
since that might be readonly.  Here be dragons, but my point was that  
every text has an underlying representation that may or may not be  
sensibly mutable.  I am a strong believer in TEXT being immutable in  
the general case.

On Feb 26, 2008, at 3:35 PM, Jay wrote:

> Is that legal or is that subverting things?
> It depends on the context?
> Can the pointers be to read only memory in the code?
>
>  - Jay
>
>
>
> > From: hosking at cs.purdue.edu
> > To: mika at async.caltech.edu
> > Date: Tue, 26 Feb 2008 15:16:47 -0500
> > CC: m3devel at elegosoft.com
> > Subject: Re: [M3devel] text inefficiency? good mutable string  
> type? arrays?
> >
> > ARRAY OF CHAR/WIDECHAR?
> >
> > These are available in the various Text implementations. For exampe,
> > Text8.T.contents. One can freely mutate these at leisure and the
> > higher-level text will appear to change!
> >
> > On Feb 26, 2008, at 2:22 PM, Mika Nystrom wrote:
> >
> > > Olaf Wagner writes:
> > >> Quoting Jay <jayk123 at hotmail.com>:
> > >>
> > >>> I know this area has been brewing under the surface a while.
> > >>> I'll bring it up. :)
> > >>>
> > >>> I assume texts are read only?
> > >>
> > >> Yes.
> > >>
> > >>> I know lots of systems have read only strings.
> > >>> There are pluses and minus to them. They can be single- 
> instanced.
> > >>> Some systems with read only strings have another type, such as
> > >>> "StringBuilder" or "StringBuffer".
> > >>> So -- I don't have a specific question, but maybe a mutable  
> string
> > >>> "class" aka "type" is needed?Not necessarily in the language  
> but in
> > >>> m3core or libm3?
> > >>> Maybe it's already there?
> > >
> > > CharSeq.T?
> >
>
>
> Climb to the top of the charts! Play the word scramble challenge  
> with star power. Play now!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080226/7be6ad97/attachment-0002.html>


More information about the M3devel mailing list