On 2010-02-14, at 09:27, Henry Minsky wrote:

> One of the cases you suggested for a lzo test case was
> 
> "Classes in the binary library that reference classes _not_ in the library,
> either auto-includes or simply includes that are in another library. "
> 
> How would this test work? If you declare a class that is not in the library,
> how do you reference it from
> the library? Do you use a <include>?

I'm thinking of two test cases:

1)  <class name="mywindow" extends="window">

i.e., the class mywindow is in a binary library and is extending a class that 
should be auto-included.

2)  <include href="../sibling/foo.lzx">
    <class name="myfoo" extends="foo">

i.e., the class myfoo is in a binary library and is extending a class that is 
explicitly include from _outside_ the binary library, say in a siblin library.

> What if I had an lzo library that defines a class "mylzoclass", that
> subclasses some external class, should
> I be able to write it with files like this?
> 
> some-external-class.lzx:
> <!-- I'm going to include this file from my main app, not as an lzo -->
> <library>
>   <class name="myexternalclass"/>
> </library>
> 
> 
> mylzo.lzx:
> <!-- I'm going to compile this file to an lzo -->
> <library>
>    <include href="some-external-class.lzx"/>
>    <class name="mylzoclass" extends="myexternalclass"/>
> </library>
> 
> main.lzx:
> 
> <canvas>
>  <include href="some-external-class.lzx"/>
>   <include href="mylzo.lzx"/>
> 
>   <mylzoclass/>
> </canvas>
> 
> Should the compiler figure out to put the "myexternalclass" into the main
> app, and the "mylzoclass" into
> the lzo file?

Yes.  The compiler has to see the include, so it knows how to extend the class, 
but it should understand that the definition of the include is external to the 
binary library (so it should _not_ emit the include class into the binary 
library).

You need to have the include be in a separate directory from the binary 
library, because the implicit definition of what is in a library is everything 
that is in the same (or subsidiary) directory.  (Rather than inventing another 
syntax, we just use the filesystem to group the files that are in a library.)

Reply via email to