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?

 - Constant refs vs refs to constants?
 - Types of hash (or 'pair') keys and elements?
 - Attributes (e.g. constantness) of hash keys and elements?
 - Ditto for arrays/lists...

I left this out of v1 of the RFC because I wanted to get some feedback on
syntax. If we can flesh this out I'll incorporate it into v2.

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.


Reply via email to