On 2006-10-30, at 14:59 EST, Jim Grandy wrote:
On Oct 30, 2006, at 11:48 AM, P T Withington wrote:
On 2006-10-30, at 14:17 EST, Jim Grandy wrote:
3. The goal of reducing the schema is noble. One way: look at
moving more of the LFC out to LZX components. This would have
the additional benefit of reducing the size of the LFC and
applications (since components are only loaded when used).
Perhaps there aren't any pieces we can move in this way, but it
is worthwhile thinking about.
I guess another way to do it would be to start generating schema
information directly from the LFC sources. Then the hand-built
scheme would just include "special forms" like <class>. I was
intending to try that tack first, but haven't investigated very
deeply. Any thoughts on why that wouldn't work?
In legals, a class that implements a tag now has a class variable
`tagname`, so that could be a start. But the syntax of each of
these tags is really encoded in the tag compiler java class for
that tag, so that is really where you would have to derive it, no?
Is `tagname` or the equivalent available from the script compiler
as well? Where does the classname-to-tagname mapping now happen?
`tagname` _is_ in script:
class LzNode {
// LzNode implements the 'node' tag. Its subclasses override this
// value with the tag that they implement and the class initializer
// installs the class as the handler for the named tag in
// ConstructorMap. (So we would like some way to say this must be
// overridden, but abstract won't cut it!)
static var tagname = 'node';
The class initializer for LzNode handles installing a class into the
constructor map under its tag name.
LZX classes are handled by UserClass, which dynamically creates a new
class (that is a subclass of LzNode) supplying the tagname as a class
property to the constructor.
var newclass = this.userclass = NewClass.make(
classname,
traitList ? traitList.concat(sup) : sup,
null,
// LzNode.intialize installs the tagname in ConstructorMap
{tagname: classname}
);