> Question 1:
>
> Afaict, even with use strict at its most strict, perl 6
> can't (in practice) complain, at compile time, if
>
> $foo.Foun
>
> refers to an undeclared Foun.
It could certainly warn you, but it can't object fatally since there's
always the possibility of a subsequent call to: eval "sub FooClass::foo {...}"
> Question 2:
>
> Should there be a strict mode that warns if a
> method name matches a built in property name?
Possibly.
Of course, the whole point of unifying the method and property access
syntaxes was to allow exactly those kinds of shenanigans. But it might
be a Good Thing if you had to explicitly turn off such a stricture to
shenan that way:
class FooClass;
no strict 'properties';
sub const (FooClass $self) {
return $self{const} || $self.prop{const}
}
Damian
- $foo.Foun (was Re: Properties and stricture) Me
- Re: $foo.Foun (was Re: Properties and stricture) Michael G Schwern
- Re: $foo.Foun (was Re: Properties and stricture) Damian Conway
- Re: $foo.Foun (was Re: Properties and stricture) Me
- "closed" property ((was Re: $foo.Fo... David L. Nicol
- Re: $foo.Foun (was Re: Properties and stricture) Damian Conway
- Re: $foo.Foun (was Re: Properties and stricture) Me
- Re: $foo.Foun (was Re: Properties and stricture) Damian Conway
- Re: $foo.Foun (was Re: Properties and stricture) Me
- Re: $foo.Foun (was Re: Properties and stricture) David L. Nicol
- Re: $foo.Foun (was Re: Properties and stricture) Me
- Re: $foo.Foun (was Re: Properties and stricture) Daniel S. Wilkerson
