At 02:29 PM 8/11/00 +1000, Jeremy Howard wrote:
>Dan Sugalski wrote:
> > The syntax is actually:
> >
> >    my type $varname;
> >
> > This is in perl 5.6.0. Modifiers go as attributes after the colon:
> >
> >   my Dog $spot : constant = new Dog;
> >
>Yes. But what about types and attributes within complex types?

What about them? Attributes can take parameters easily enough:

   my bigint $pi : constant : digits(7) = "3.1415926"

>Also, do we want to be able to specify types and attributes within a sub
>prototype? It would be nice to guarantee that subs don't mutate particular
>parameters, that certain data will not be aliased, etc, so that appropriate
>optimisations can be done.

I'm not sure I'd sweat the optimization stuff at this point. Besides, it's 
unlikely that the optimizer will know anything about attributes of non-core 
variable types anyway, so...

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to