From: Dan Sugalski [mailto:[EMAIL PROTECTED]]
> At 11:09 PM 3/23/2001 +0000, Simon Cozens wrote:
> >
> > For instance, chr() will produce Unicode codepoints. But
> > you can pretend that they're ASCII codepoints, it's only
> > the EBCDIC folk that'll get hurt. I hope and suspect
> > there'll be an equivalent of "use bytes" which makes
> > chr(256) either blow up or wrap around.
>
> Actually no it won't. If the string you're doing a chr on is
> tagged as EBCDIC, you'll get the EBCDIC value. Yes, it does
> mean that this:
>
> chr($foo) == chr($bar);
>
> could evaluate to false if one of the strings is EBCDIC and
> the other isn't. Odd but I don't see a good reason not to.
> Otherwise we'd want to force everything to Unicode, and then
> what do we do if one of the strings is plain binary data?
Someone please clue me in. A pointer to an RFC which defines the use of
colons in Perl6 among other things would help.
Why not have subsequent uses of : on the same variable name perform a cast?
Or perhaps better returned the casted value?
$foo : EBCDIC = 'A'; # declares $foo as EDCDIC typed string
$bar = $foo : UTF8-C; # assigns cast value of $foo to $bar
$bar := UTF8-D; # casts $bar to different string type
ord($foo) != ord($bar);
ord($foo : utf8) == ord($bar : utf8);
If there is a default string type... perhaps it could be:
ord($foo:) == ord($bar:);
Garrett