On 4 Dec 2007, at 15:39, Larry Wall wrote:
It's kinda caught between two other notions.  On the one hand,
we're trying to reserve ` for user definition, in part because it's
so difficult to tell from ' in many fonts so we're avoiding it for
standard usage.  On the other hand, it's not clear that units aren't
generally just simple multiplication by a scaling factor: 1*in, where
1*in == 2.54*cm, for instance.  Units could also be viewed as type
conversion, which would give us kg(1) and 1.kg as conversion forms
in current Perl 6.  Since 1.kg is essentially using the units as a
postfix, presumably the 1kg form could also work on literals, just as
we currently allow 1i to convert 1 to i via the postfix:<i> operator.
(And I suppose there's a sense in which 10e-2 is specifying the
scaling factor of the left side explicitly.)

I've missed prior discussions about this - apologies.

Is there any thought of doing dimensional analysis?

2m/s * 3s = 6m

Is there any thought of using units to denote, e.g. string encoding?

my $amp  = '&';     # No unit, plain text
my $body = "<body>$amp</body>"html; # gets <body>&amp;</body>

In other words interpolating plain text into a string that has the unit 'html' would force a (user defined) html upgrade on the interpolated text.

On the other hand

my $amp  = '&amp;'html;     
my $body = "<body>$amp</body>"html; # gets <body>&amp;</body>

Andy Armstrong, Hexten

Reply via email to