> > class Demo {
> > my $threshold is const = 100;
>
> Hmm... is a "my const" the same as an "our const"?
No. 'my' is per-instance; 'our' is per-class.
> If so, does this mean that there will be no such thing as a
> C++-style const (constant per instance)?
>
> I'm thinking something like:
>
> class Demo {
> my $id is immutable;
> method INIT ($demo_id is initializer ($id)) {}
>
> "is initializer" is rather long, but you get the idea.
I'd do that like so (using Larry's preferred syntax):
class Demo;
my $.id is const;
method INIT ($idval) { $.id := $idval }
Damian