Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Bit ops on strings
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Gerald Butler  
View profile  
 More options Apr 30 2004, 9:47 am
Newsgroups: perl.perl6.internals
From: gerald.but...@jewels.com (Gerald Butler)
Date: Fri, 30 Apr 2004 09:47:18 -0400
Local: Fri, Apr 30 2004 9:47 am
Subject: RE: Bit ops on strings
If I may interject for a moment:
-----Original Message-----
From: Bryan C. Warnock [mailto:bryan.warn...@raba.com]
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.  


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.