What will happen if the attribute's names are the same but declared with different keyword?

2005-08-17 Thread Yiyi Hu
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

Need correction to S06

2005-08-22 Thread Yiyi Hu
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

Can a scalar be "lazy" ?

2005-08-22 Thread Yiyi Hu
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

Is there a way to generate an object without new?

2005-10-27 Thread Yiyi Hu
What I want to do, is a bit like... class A { has $.b; method show { "$.b".say }; }; A( b => 5 ).show;` Thanks, Xinming

Is S05 correct?

2006-02-02 Thread Yiyi Hu
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

Instance attributes collision

2006-02-12 Thread Yiyi Hu
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

Heredoc issue in pugs.

2006-08-22 Thread Yiyi Hu
#!/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