Ingo Blechschmidt writes:
> that's really convenient, but what will the following code do?
> my $x = (a => 42); # $x is a Pair.
> $x = 13; # Is $x now the Pair (a => 13) or
> # the Int 13?
It's the Int 13. Your example looks a lot like this one:
m
Markus Laire wrote:
I have two questions about this example code
(taken from http://svn.openfoundry.org/pugs/examples/sendmoremoney.p6)
I have a few issues with this code. Or at least observations of how it
differs from the classic "SEND + MORE = MONEY" problem. see below.
#!perl6
use v6;
my $s;
Hi,
Uri Guttman stemsystems.com> writes:
> note the binding := which is not the same as =. binding is
> similar to aliasing. in the above case it matches the names
> and assigns the new values accordingly.
that makes sense. But consider:
> > "IB" == Ingo Blechschmidt web.de> writes:
> IB
> "IB" == Ingo Blechschmidt <[EMAIL PROTECTED]> writes:
IB> Hi,
IB> quoting http://dev.perl.org/perl6/synopsis/S06.html:
>> Pairs can be used as lvalues. The value of the pair is the
>> recipient of the assignment:
>>
>> (key => $var) = "value";
>>
>> When binding pairs, name
Hi,
quoting http://dev.perl.org/perl6/synopsis/S06.html:
> Pairs can be used as lvalues. The value of the pair is the
> recipient of the assignment:
>
> (key => $var) = "value";
>
> When binding pairs, names can be used to "match up" lvalues
> and rvalues:
>
> (who => $name, why => $rea
I have two questions about this example code
(taken from http://svn.openfoundry.org/pugs/examples/sendmoremoney.p6)
(btw, a really nice example of how to use junctions - just try to write
this in perl5 :)
#!perl6
use v6;
my $s;
my $e;
my $n;
my $d;
my $m;
my $o;
my $r;
my $y;
$s = any(0..1