On Mon, Oct 29, 2001 at 11:57:47AM +1100, Damian Conway wrote:

> AJS> How would this play with constants?
> 
>         class Demo {
>                 my $threshold is const = 100;

Hmm... is a "my const" the same as an "our const"? 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.

Does this help Perl at all? Maybe. It depends on the implementation
of the core. Does it help Perl programmers? I think so. It's nice
to be able to state with surety that a member will not be changed
by any of the methods.

> > Seriously, it would be nice to have a BNF somewhere, even if it changed
> > every day, and had a few "alternates" sections... I'd be interested
> > in starting this if no one else has their heart set on doing it. Perhaps
> > I could get it into a CVS archive so that we can all edit it on our
> > own branches.
> >
> > I'm not proposing anything super-useful for actually cranking out
> > Perl6's perly.y, but just a high-level view of the operators and
> > essential syntax.
> 
> I'm planning to write a Perl6::Classes module as a proof-of-concept to
> accompany my proposal.

Ok. I'll keep an eye out for this, and meanwhile I'll dust off my
BNF skills.

-- 
Aaron Sherman
[EMAIL PROTECTED]             finger [EMAIL PROTECTED] for GPG info. Fingerprint:
www.ajs.com/~ajs        6DC1 F67A B9FB 2FBA D04C  619E FC35 5713 2676 CEAF
  "Write your letters in the sand for the day I'll take your hand
   In the land that our grandchildren knew." -Queen/_'39_

Reply via email to