Re: Literal Values

[email protected] (Larry Wall)
Newsgroups perl.perl6.documentation
Message-ID <[email protected]>
On Tue, Nov 12, 2002 at 01:20:04PM -0700, Luke Palmer wrote:
: > =head2 String as vector of ordinals
: > 
: > Literals of the form C<v1.2.3.4> are parsed as a string
: > composed of characters with the specified ordinals.  This
: > is an alternative, more readable way to construct
: > (possibly unicode) strings instead of interpolating
: > characters, as in C<\x{1}\x{2}\x{3}\x{4}>. The leading C<v>
: > may be omitted if there are more than two ordinals, so
: > C<1.2.3> is parsed the same as C<v1.2.3>.
: 
: This is equivalent to 256:1.2.3.4

Not quite.  v1.2.3.4 is a string of four characters that only happens
to look like the internal representation of 256:1.2.3.4 on a 32-bit
big-endian machine.  And it's perfectly possible to have v1234.4321,
which is a two character string, while 256:1234.4321 is an error.

Larry
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.