Re: Error calling bless in non-default constructor

2007-05-15 Thread Matthew Keene
t $test .= new(:string); # TIMTOADY and all that ;) You can pass objects to BUILD that you don't store in the object: class MattTest { submethod BUILD (:$foo) { say $foo; } } hth, -db. my $test = MattTest(:string('abc')); # Check to see the class is the right kind

Error calling bless in non-default constructor

2007-05-15 Thread Matthew Keene
I'm trying to use a non-default constructor for a class under Pugs 6.2.13, like so class MattTest { sub new (Class $class : Str $string) { say "Passed $string to the constructor for $class" ; return $class.bless ; } } my $test = MattTest.new('abc') ; This is failing with the fol