Newsgroups: rec.arts.int-fiction
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!howland.erols.net!newsfeed.fast.net!uunet!dca.uu.net!ash.uu.net!world!buzzard
From: buzzard@world.std.com (Sean T Barrett)
Subject: Re: OT: String Manipulation Hell
Message-ID: <GF6uyx.En8@world.std.com>
Date: Tue, 19 Jun 2001 17:52:09 GMT
References: <g2PV6.221676$eK2.48004027@news4.rdc1.on.home.com> <wkd781ykwo.fsf@turangalila.harmonixmusic.com> <1ev89fd.jjqdib1x2gkfqN%news@davidglasser.net> <3b2f6ce5.707368184@news.worldonline.nl>
Organization: The World Public Access UNIX, Brookline, MA
Lines: 31
Xref: news.duke.edu rec.arts.int-fiction:88880

Richard Bos <info@hoekstra-uitgeverij.nl> wrote:
>news@davidglasser.net (David Glasser) wrote:
>> For example, I'd like to be
>> able to say that certain parts of a string should be 'bold', but without
>> embedding more characters into the string (and thus messing up length
>> operations, wrapping, etc).  Do any languages really support this?
>
>I doubt it, because I don't think it can be done. You see, such tags are
>information, and that information needs to be stored somewhere. Store it
>in the string, and you mess up its length

I'm not offhand familiar with any languages that allow it, but there
is no reason it can't be done. It can be done since the language
(or library) defines how the length of a string is computed; I can
store a string with 80 bits per character if I want, and compute the
length as appropriate. (C and C++ weak-typing seem to prejudice
people to thinking of memory layouts, instead of abstract data
types.)

Typesetting languages (e.g. PostScript and TeX) are biased, like
Inform, towards outputting, and, I believe, tend to think of bold
and etc. as qualities of the output--of rendered glyphs, not of
text strings. (This is definitely the case with PS; TeX I'm not
that familiar with.)

It's possible that if you create a rich edit control in Win32,
the control might have a character-access mechanism that you
could use to get this effect, but I doubt it would be anything
other than clumsy.

SeanB
