Larry Wall wrote:
> But also note that there are several other ways to predeclare
> types implicitly.  The 'use', 'require', and 'need' declarations
> all introduce a module name that is assumed to be a type name.

Just to clarify: it's possible to define a module within a file,
rather than as a file; and in fact the usual means of defining classes
and roles is an example of this, since they are specialized kinds of
modules.  Correct?  So if I' understanding this correctly, you should
be able to say something like:

    use Foo;
    class Bar { ... has Foo $x ... }
    class Foo { ... }

...where the dots are stand-ins for irrelevant code.  In effect, "use"
tells the compiler that Foo is a noun, so that the parser knows the
proper way to handle it.  It also looks for the definition of Foo; but
will it start screaming bloody murder if it can't find the definition
right away?  Have I failed to correctly tell it where to look for the
definition?  (i.e., do I need to say something like "use ::Foo" to let
the parser know that the definition is in this file?)

-- 
Jonathan "Dataweaver" Lang

Reply via email to