If I may interject for a moment: -----Original Message----- From: Bryan C. Warnock [mailto:[EMAIL PROTECTED] Sent: Friday, April 30, 2004 9:08 AM To: Dan Sugalski Cc: Perl6 Internals List Subject: Re: Bit ops on strings
On Thu, 2004-04-29 at 13:04, Dan Sugalski wrote: > I think left and right shift of strings should work the same way that > shifts on ints works--that is, it doesn't grow, bits just fall off > the end. You can decide whether to sign-extend or 0-extend, either > one's OK. Have we[1] finished working out what a string is yet? [1] And by "we", I mean "you"[2]. [2] And by "you", I mean "you" plural. ------------------------------------------------------------------------- I have been following the discussion of strings on this list over the last few weeks. It seems that there is somewhat of a disconnect in various definitions of what is a "string". It seems as though there needs to be a hierarchy to this with a little more clear definition. May I humbly propose the following: 1. String - low-level, abstract, base class (or in Perl6 terms role -- I think) which represents a "logically" contiguous series of Parrot Int 2. BinaryString - inherits from String, represents a "logically" contiguous series of "bytes/bits" 3. TextString - inherits from String, represents a series of characters (where character is an abstract thingy which in the concrete of a specific "font" is a particular "glyph") -- I'm hand-waving at the concept of "font" and "glyph" here, but, I think you get the idea. 4. RichTextString - inherits from TextString, represents a "String" which various "properties" assigned to various substrings. * Now, "String" should not have any methods/properties which do not apply to both the definition of a "BinaryString" and a "TextString". * Things like "LSR/LSL" should only apply to "BinaryString". * Properties like "language", "encoding", etc. only apply to "TextStrings". Same for methods like "substr" (though this could be a "String" method like "slice" which gives a slice of either a binary or text string I suppose). Anyway, the important point in all this is we should not mix the concept of a "TextString" and "BinaryString". These are two distinct things in abstract terms. They should not be treated the same (IMHO). The information contained in this e-mail message is privileged and/or confidential and is intended only for the use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify us by telephone (330-668-5000), and destroy the original message. Thank you.