develooper Front page | perl.perl6.language | Postings from August 2001

Re: Will subroutine signatures apply to methods in Perl6

Thread Previous | Thread Next
Damian Conway
August 25, 2001 00:42
Re: Will subroutine signatures apply to methods in Perl6
Message ID:
Uri writes:

   >   DC> One might also envisage a C<use strict 'typing'> pragma to require
   >   DC> that all lexicals be typed.
   > do you mean lexical params in a sub signature? or all lexicals in the
   > current scope which contains the pragma?


Some people will want one; some, the other. We may need two pragmas. ;-)

   > required typing for all lexicals feels too strong. many lexicals are
   > just ordinary scalars and don't type well unless we require an
   > int/string/float/ref type.

Yep. But people want static type-checking and that's the only reasonable 
way to get it.

   > what about making that mean that any scalar being assigned a method call
   > (compile time checked only), must have a type? it would not be too broad
   > and should be simple to check and it has useful behavior. 

It should probably extend to any variable used as a subroutine/method argument,
but it's a good idea.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About