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

Re: Will subroutine signatures apply to methods in Perl6

Thread Previous | Thread Next
From:
Damian Conway
Date:
August 25, 2001 00:42
Subject:
Re: Will subroutine signatures apply to methods in Perl6
Message ID:
200108250742.RAA38625@indy05.csse.monash.edu.au
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?

any(@above).

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.

Damian

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About