Re: Inlining, name scoping, defining

Paul Burchard (burchard@horizon.math.utah.edu)
Wed, 12 Oct 94 18:56:52 -0600


"Gavin Bell" <gavin@krypton.engr.sgi.com> writes:
> Separator {
> File { name "CoolMaterials.vrml" } # Contains DEF Gold
> USE Gold
> Cube { }
> }

> Separator {
> DEF Gold Material { .... } # First use of gold material
> Cube { }
> File { name "CoolMaterials.vrml" } # hmm....
> }

Whether or not the reordered version is incorrect depends on the
semantics of DEFs. In a languages which are "referentially
transparent"/"declarative"/"functional" (i.e. without any assignment
operators), it is immaterial whether references come before or after
definitions in the same scope. (OOGL works like this, although it
lacks scoping.)

On the other hand, changing the semantics in this way would make a
rather serious incompatibility between VRML and Inventor.

--------------------------------------------------------------------
Paul Burchard <burchard@math.utah.edu>
``I'm still learning how to count backwards from infinity...''
--------------------------------------------------------------------