#!/usr/bin/env pugs
my $a = q:t /END/
test
END;
$a.perl.say;
Above example works ok in pugs, But the problem is.
From S02
Heredocs are no longer written with <<, but with an adverb on any
other quote construct:
print qq:to/END/;
Give $amount to the man behind curtain number $curta
For perl 6,
Array and Scalar are in different namespace.
So,
class A { has $.a; has @.a };
what will A.new.a return by default?
An Error? or Scalar has a higher priority?
Thanks,
xinming
Hmm,
There are sevral appears in S05 which use => instead of -> in a for loop.
So, Is this a typo?
eg:
for @{$} => $pair {
say "Key: $pair[0]";
say "Val: $pair[1]";
}
Thanks,
Xinming
What I want to do, is a bit like...
class A {
has $.b;
method show { "$.b".say };
};
A( b => 5 ).show;`
Thanks,
Xinming
my( $s, $t ); $s = "value t is $t"; $t = "xyz"; print $s;
in perl 5, it will give a warning, and won't do "right" thing.
we have to use other way or eval '$s' before print to get a "correct" answer.
So I wonder, If we can make $scalar lazy also. As array now is lazy by default.
Even if making sca
svnbot6 r6401 | iblech++ | *%slurpy_hashes exist :)
svnbot6 r6401 | iblech++ | It uses the semantics of
svnbot6 r6401 | iblech++ |
http://www.nntp.perl.org/group/perl.perl6.language/22860, i.e.
svnbot6 r6401 | iblech++ | sub foo (*%hash) {...}, foo(hash =>
{...}); # works
svnbot6
class T
{
has $.a =1;
my $.a=2;
};
my T $o .= new;
$o.a().say;
What the result will be please?
1 or 2?
Or an error?
Thanks,
Xinming