|
|
Choosing A Webhost: |
Re: Method/attribute chaining: msg#00118lang.perl.perl6.compiler
Hi, I've written up the case I found as a test, please feel free to add it if it's useful. All tests pass apart from the last one which tests attribute chaining. Tested on Pugs 6.2.5. #!/usr/bin/pugs use v6; use Test; plan 7; #Setup class Foo { has $.bar is rw; } my $foo = Foo.new; my $foo2 = Foo.new; #Sanity check isa_ok($foo, 'Foo'); isa_ok($foo2, 'Foo'); #Setup chain $foo.bar = $foo2; $foo2.bar = 'baz'; #Sanity check part two is($foo2.bar, 'baz', '... got the right value in $foo2'); is($foo.bar =:= $foo2, 1, '... $foo is storing $foo2'); #Extract last part of chain my $foo3 = $foo.bar; #and check its fine is($foo3 =:= $foo2, 1, '... we can retrieve $foo2 as $foo3'); is($foo3.bar, 'baz', '... got the right value in $foo3'); #Check chaining lives_ok{ $foo.bar.bar == 'baz' ; }, '... attribute chaining is OK'; On 24 May 2005, at 12:52, Adrian Taylor wrote: Hi, Alex Gutteridge EBI Wellcome Trust Genome Campus Hinxton Cambs CB10 1SD UK Tel: 01223 492546 Email: alexg@xxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Perl development server, Alberto Manuel Brandão Simões |
|---|---|
| Next by Date: | Re: Undef issues, Stuart Cook |
| Previous by Thread: | Re: Method/attribute chaining, Adrian Taylor |
| Next by Thread: | Undef issues, Adrian Taylor |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |