Melvin Smith writes:
: At 07:12 AM 4/5/2002 +1000, Damian Conway wrote:
: >Melvin Smith wrote:
: >More generally, it also depends whether you think of out-of-band properties as
: >nouns or adjectives. For example:
: >
: >         class Toaster is silver is shiny is hot is little {...}
: >
: >vs:
: 
: After rereading the example, this one bugs me.
: 
: This is compile time, and should be an inline property.
: 
: I see the potential for another Perl 'non-warning' bug, where
: someone typed:
: 
: class Appliance {
: ....mucho lines of code...
: }
: 
: class Toaster is appliance {
: ....
: }
: 
: This trivial example would of course be spottable to all but the blindest
: programmer, but what about the more conceivable...
: 
: class ToasterException is MyExceptionLibinHungarianNotationBurntBread
: {
: }
: 
: Oops, the exception is really MyExceptionLibInHungarianNotationBurntBread
: but Perl6 wouldn't complain, right? It creates a property.

No, compile-time properties will likely be declared as a kind of class,
so that such typos would be caught.  But however compile-time properties
are implemented, there has to be an implementation available at the
time of the declaration because such properties are primarily for the
purpose of warping the nature of the variable itself, and you can't
really compile the code without knowing what "is blurfl" means.  It might
mean "blow up on any reference to this".  :-)

In the particular case of a class property, we'd really like to know
its derivation at compile time whenever possible because this gives the
optimizer more information to work with.

: It scares me to be able to _declare_ a new attribute with the same operator
: that I typically use to _inherit_ an existing class or property.
: 
: Why not make 'is' a little tidier; require us to declare attributes inline, and
: let us tag _objects_ (not classes) at runtime with different notation?

Objects *do* use a different notation, because objects are constructed
at run-time.  Whether run-time properties must be predeclared has not
yet been decided.  I can argue it both ways.

Larry

Reply via email to