develooper Front page | perl.perl6.language | Postings from May 2005

Re: Quick question: '1.28' * '2.56'

Thread Previous | Thread Next
From:
Luke Palmer
Date:
May 17, 2005 06:26
Subject:
Re: Quick question: '1.28' * '2.56'
Message ID:
7ca3f01605051706264c164edc@mail.gmail.com
On 5/17/05, Autrijus Tang <autrijus@autrijus.org> wrote:
> Imagine:
> 
>     pugs> '1.28' * '2.56'
>     3.2768
> 
> What is (or should be) going on here here?
> ...
> [6] something else?

I still don't quite have a handle on the object system.  Maybe:

    subtype Num of Str where /^ <number> $/;

?

Maybe s/Num/NumLike/ or something?  Anyway, that's how I think of it
at least: not that a Str is converted into a Num, but rather that
certain Strs are Nums.

Luke

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About