Re: Problems with defining a class

2022-08-24 Thread Ralph Mellor
cf https://github.com/rakudo/rakudo/issues/1985 On Wed, Aug 24, 2022 at 2:47 AM Kevin Pye wrote: > > Hi, > > The following fairly simple code works well: > >class A { > has num $!a is required is built; > }; > > dd A.new(a => 1e0); > > producing "A.new(a => 1e0)". > > However, if w

Re: Problems with defining a class

2022-08-23 Thread Kevin Pye
That makes some reasonable sense. I guess "is required" and native attributes are more-or-less incompatible. Kevin. On Wed, 24 Aug 2022, at 12:45, William Michels via perl6-users wrote: > It seems to work okay if I change `num` to `Num`: > > class A { > has Num $!a is required is built; >

Re: Problems with defining a class

2022-08-23 Thread William Michels via perl6-users
It seems to work okay if I change `num` to `Num`: class A { has Num $!a is required is built; }; dd A.new(a => 0e0); #returns: A.new(a => 0e0) Note, I'm on a fairly old version of Rakudo [moar (2021.06). HTH, Bill. On Tue, Aug 23, 2022 at 6:47 PM Kevin Pye wrote: > > Hi, > > Th

Problems with defining a class

2022-08-23 Thread Kevin Pye
Hi, The following fairly simple code works well: class A { has num $!a is required is built; }; dd A.new(a => 1e0); producing "A.new(a => 1e0)". However, if we make a slight change: class A { has num $!a is required is built; }; dd A.new(a => 0e0); (i.e. initiali