[Laszlo-dev] defining classes in any order in LZX
Henry Minsky
henry.minsky at gmail.com
Wed Feb 11 14:57:53 PST 2009
Yeah I was suggesting the tag compiler, as Tucker described. Having
the script compiler do it too
would be a bonus.
I'll file a request.
On Wed, Feb 11, 2009 at 5:46 PM, P T Withington <ptw at pobox.com> wrote:
> I thought Henry's question was with regard to the tag compiler.
> Doing it in the script compiler would be a bonus, but it would not solve the
> issue Henry was hitting. The tag compiler currently requires the super
> model to exist.
>
> On Feb 11, 2009, at 17:40, Donald Anderson <dda at ddanderson.com> wrote:
>
> Are you suggesting we handle this in the tag compiler? Are there advantages
> to that?
> Might be useful to have the capability in lzs code too.
> - Don
> On Feb 11, 2009, at 5:29 PM, P T Withington wrote:
>
> This should be fairly easy. We already allow forward references to classes
> when instantiating them. It would just mean delaying completing the model
> until you need it, rather than at the time you parse it.
>
> On Feb 11, 2009, at 16:22, Henry Minsky <henry.minsky at gmail.com> wrote:
>
> Currently the way the LZX compiler works, this code gives an error
>
> "undefined superclass foo for class bar"
>
> <class name="bar" extends="foo"/>
>
> <class name="foo"/>
>
>
>
> because the compiler parses classes internally in the lexical order
>
> they occur in the source, and foo is not defined
>
> yet when it tries to compile bar.
>
> However, we could make the compiler do a pass that stores the class
>
> declarations and parses them on demand
>
> so that the order you declare them lexically doesn't matter.
>
> I guess we've gotten this far without the compiler doing this for you,
>
> but I'm wondering if it would
>
> be a useful thing to do, considering that other object oriented
>
> languages generally seem to allow
>
> it.
>
> --
>
> Henry Minsky
>
> Software Architect
>
> hminsky at laszlosystems.com
>
>
> --
> Don Anderson
> Java/C/C++, Berkeley DB, systems consultant
>
> voice: 617-306-2057
> email: dda at ddanderson.com
> www: http://www.ddanderson.com
>
>
>
>
>
>
--
Henry Minsky
Software Architect
hminsky at laszlosystems.com
More information about the Laszlo-dev
mailing list