Re: Numeric literals, take 1
[email protected] ("Joseph F. Ryan") Sat, 16 Nov 2002 02:52:09 -0500
| Newsgroups | perl.perl6.documentation |
|---|---|
| Message-ID | <[email protected]> |
Frank Wojcik wrote:
>On Thu, Nov 14, 2002 at 07:58:55PM +0100, Angel Faus wrote:
>
>
>>The C<1i> and C<-1i> numbers can be also written
>>respectively, C<i> and C<-i>, so the previous example
>>could be rewritten:
>>
>> my $z = 2.3 + i;
>>
>>
>
>OK. So, what does this print?
>
>sub i {return 40}
>
>my $z = 2.3 + i;
>print "z:$z\n";
>
>
>
>
>
Thats an easy one; it will print:
z::42.3
You can only expect so much out of the parser; moving from interpolating
simple scalars and arrays to interpolating full hashes and subs is already
a huge step. Knowing to interpolate full expressions would be more
harmful than helpful.