Re: DEF-USE

Gavin Bell ([email protected])
Fri, 2 Jun 1995 16:58:05 -0700


On Jun 2, 12:06pm, Robert DiFalco wrote:
> Is something like this currently illegal? Looking at the semantic of USE,
> its as though it should be able to do that.

DEF/USE names are file-scoped. They do NOT leak across files.

Allowing them to leak across files will, I guarantee, cause massive headaches
for implementors.

Imagine a file that contains:

LOD {
ranges [ ... ]
WWWInline { name "http://...." } # DEF Foo inside there
}
USE Foo

The beauty of VRML is that an implementation can decide to defer the loading
of the stuff in the WWWInline node until the user is close enough to see it.

If you allow DEF/USE to leak across files, that is lost. And once that is
lost, the infinite scalability of VRML is lost.

If you really want the functionality of being able to refer to objects DEF'ed
in other files, then create a new kind of WWWInline that refers to part of a
file instead of the whole thing. I don't think that's worth it-- you can
always put the parts of your objects/worlds that you want to refer to from
other objects/worlds in separate files.

> Additional, I think it would be hella usefull to be able to DEF things
> without them being "used" until you actually USE them.

There's already a syntax for that:
Switch { DEF Foo .... }

The default for a Switch node is to traverse none of its children, so you've
DEF'ed the node without USE'ing it. Put several DEF's under the switch if
that's convenient...