Ah, that's probably the confusion. The OpenLaszlo compiler tries very hard to DWIM (do what I mean), which can be confusing if you are coming from a more pedantic language that refuses to compile a single line until every 'i' is dotted and 't' crossed. :)
One of OpenLaszlo's philosophies is that the language should try to stay out of your way and let you get on with your ideas rather than nit-picking you to death because you had a forward reference, missing declaration, or didn't give an implementation for a method that will never be called. On 2009-12-02, at 10:14, Henry Minsky wrote: > Or maybe he's asking how can you refer to a class in a library file when > there is no explicit <include> for it? > > The Laszlo compiler reads the whole LZX program into memory, processing all > the <include> tags, so it is then possible that a library file can see other > class definitions as long as some other file has <included>ed them someplace > in the program. This can be confusing, and it is always better to > explicitly include the classes you are going to use in each file. The > compiler is smart enough to only > include the classes from a file once even if multiple <include> tag > reference it. > > On Wed, Dec 2, 2009 at 10:04 AM, P T Withington <[email protected]> wrote: > >> Not sure what your question is. >> >> In Java (and many of its relatives), each class must be defined in its own >> file. I don't know why. Maybe this makes it easier on your IDE. >> >> But if that is your question, OpenLaszo has no such constraint. You can >> define as many different classes as you like in a file, in any order, and it >> will sort them out and make sure the class is defined before it is used. >> >> On 2009-12-02, at 07:31, cem sonmez wrote: >> >>> Hi all >>> I am taking a look at the LZProject in the demos directory of lps. Trying >> to >>> understand the operations but one thing that i couldnT undestand well. >>> In most of the lzx files, classes use the external classes in the class >>> definetion instead of using the <include> tag. For example : >>> >>> I18NFlag.lzx >>> ___________ >>> <library> >>> <class name="I18NFlag" extends="view"> >>> <!-- PUBLIC ATTRIBUTE SECTION --> >>> >>> <ServiceConnector name="i18nConn" form="$once{parent}"> >>> <method name="handleResult" args="message"> >>> // Nothing to do >>> </method> >>> </ServiceConnector> >>> .... >>> How do we manage to do this. I always use the <include> tag, when i want >> to >>> create an instance of external lzx classes. >>> Maybe this seems to you a ridiculous question, but for a while i m >> confusing >>> this issue. >>> >>> Thanks. >>> >>> -- >>> Cem SONMEZ >> >> >> > > > -- > Henry Minsky > Software Architect > [email protected]
