Hi, On 12/18/2015 03:46 AM, TS xx wrote: > Hello dear perl6 users, > > I was in the need of declaring a member variable as a constant integer.
I don't understand this. If it's a constant, why does it need to be
member at all? A member is per-instance storage, which seems to be a
waste for a constant.
Just do
class MyClass {
method TheConstant { 42 }
}
Then you can use it both on the class:
say MyClass.TheConstant
or on an instance:
say MyClass.new.TheConstant
Cheers,
Moritz
