Trey Harris wrote:
One thing that occurs to me: following this "contract" or "promise"
analogy, what does C<...> mean in a role or class?

Unless I've missed somewhere in the Synopses that explicates C<...>
differently in this context, yada-yada-yada is just code that "complains
bitterly (by calling C<fail>) if it is ever executed".  So that's fine for
an abstract routine at runtime--code calls it, and if it hasn't been
reimplemented, it fails.

But unless something else is going on with C<...>, as far as the language
is concerned, a routine with body C< {... }> *is* implemented, as surely
as a routine with body C<{ fail }> is implemented.  So the routine is only
"abstract" insofar as you'll need to reimplement it to do anything useful
with it.

-snip-

Is my inference correct?

I hope not.  My understanding is that '{ ... }' is supposed to
represent the notion of abstract routines: if you compose a role that
has such routines into a class or package, I'd expect the package to
complain bitterly if any such routines are left with yada-yadas as
their codeblocks, on the basis that while roles can be abstract,
classes and packages should not be.

--
Jonathan "Dataweaver" Lang

Reply via email to