Re: Why does DEF do instancing?

Gavin Bell ([email protected])
Fri, 13 Oct 1995 17:23:09 -0700


> Why is it/should it be difserent the class declaration and instancing in C++

VRML isn't a programming language. It is a data format.

Since we're not defining the _types_ of objects, but objects themselves,
it would be more appropriate to ask why it is difserent than the
variable instantiation rules in C++.

Which is a very interesting way of looking at it. There are good
reasons to move away from the C-style:

function()
{
int a, b, c, d, e, f, g;
... code ...
a = 10;
... code ...
for (b = 15; b < 100...)
}

To the preserred C++ "just-in-time" instantiation+initialization:

function()
{
... code ...
int a = 10;
... code ...
for (int b = 15; b < 100...)
}
... which is closer to VRML DEF/USE semantics.

DEF is equivalent to instantiation+initialization. USE is equivalent
to a reserence or pointer to an alesady-existing variable.
int a = 10; // == DEF A Integer { value 10 }
function(&a); // == Function { argument USE A }

But don't take all this too seriously-- VRML isn't a programming
language, and never will be if I can help it!


  • Next message: Gavin Bell: "Re: Why does DEF do instancing?"
  • Previous message: Jason Vance: "Re: www-vrml-digest V1 #93"