Uri Guttman wrote:
[Re: use strict 'typing'; my $rex = new Dog; $rex.bark]
> then it should be a compile time error at the assignment to $rex
> and not later. you can't trace $rex at compile time to see what
> kind of object (if any) was assigned to it. so the illegal method
> call can't (easily)
At 09:18 PM 8/24/2001 -0700, Brent Dax wrote:
>I meant that, if we
>know $spot is supposed to have a Dog in it, can we avoid checking if it
>really does (at least some of the time) and maybe shuck some overhead by
>doing so? Perhaps we only check after each assignment to $spot, and
>when we check
"Brent Dax" <[EMAIL PROTECTED]> writes:
> # From: Uri Guttman [mailto:[EMAIL PROTECTED]]
> # BD> equivalent) in method lookups? In other words, if
> # $spot is declared to
> # BD> hold a Dog, can we assume that it does, thus skipping
> # the check with
> # BD> 'ref' normally used for method
Uri Guttman <[EMAIL PROTECTED]> writes:
> > "DC" == Damian Conway <[EMAIL PROTECTED]> writes:
>
> DC> One might also envisage a C 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
# -Original Message-
# From: Uri Guttman [mailto:[EMAIL PROTECTED]]
# Sent: Friday, August 24, 2001 8:56 PM
# To: [EMAIL PROTECTED]
# Cc: [EMAIL PROTECTED]
# Subject: Re: Will subroutine signatures apply to methods in Perl6
#
#
# >>>>> "BD" == Brent Dax &
# -Original Message-
# From: Uri Guttman [mailto:[EMAIL PROTECTED]]
# Sent: Friday, August 24, 2001 4:09 PM
# To: [EMAIL PROTECTED]
# Cc: [EMAIL PROTECTED]
# Subject: Re: Will subroutine signatures apply to methods in Perl6
#
#
# >>>>> "DC" == Damian Conway &
Uri writes:
> DC> One might also envisage a C 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
> "BD" == Brent Dax <[EMAIL PROTECTED]> writes:
BD> # BD> my $rex=Dog.new;#ok at
BD> # this point...
BD> #
BD> # BD> $spot.bark(); #ok
BD> # BD> $fido.bark(); #ok
BD> # BD> $rex.bark();
> "BD" == Brent Dax <[EMAIL PROTECTED]> writes:
BD> # From: Uri Guttman [mailto:[EMAIL PROTECTED]]
BD> # use strict 'typing' ;
BD> #
BD> # my $foo = Dog.new() ;
BD> #
BD> # that fails at compile time.
BD> #
BD> # my Dog $spot = Dog.new() ;
BD> #
BD>
> "DC" == Damian Conway <[EMAIL PROTECTED]> writes:
DC> One might also envisage a C 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?
required typing for all lexicals feels too
Garrett asked:
> Any word from on high whether subroutine signatures will apply to
> methods in Perl6?
Well, I hardly qualify as "on high" ("on *a* high" perhaps?) but I can
definitely say this: They will and they won't. ;-)
At compile-time, signatures can only be honoured if the com
Garrett Goebel wrote:
>
> Any word from on high whether subroutine signatures will apply to methods in
> Perl6? There's RFC128 and RFC97... but they both mostly dodge the issue of
> methods.
>
> The absense of method signatures for specifying required, optional, and
> named parameters... not to
12 matches
Mail list logo