Re: Constants as members of a class

2015-12-17 Thread Brock Wilcox
Two things jump out at me. One is that I think you don't need that "new" method. Second -- yes, this is a very old interpreter. I unfortunately don't know about the twigil variable constant things. --Brock On Thu, Dec 17, 2015 at 9:46 PM, TS xx wrote: > Hello dear

Constants as members of a class

2015-12-17 Thread TS xx
Hello dear perl6 users, I was in the need of declaring a member variable as a constant integer. After many syntax tryouts I came to this one: class MyClass { has int $.myConst; method new () { return self.bless(); } submethod BUILD () { constant $!myConst = 1;