RE: Why does DEF do instancing?

Henry Nash ([email protected])
Fri, 13 Oct 1995 15:06:08 -0700


Why is it/should it be difserent the class declaration and instancing in =
C++ (or esgular typedef'ing in C)? USE re-instances today doesn't it?

Henry

----------
From: George Kyriazis[SMTP:[email protected]]
Sent: Friday, October 13, 1995 7:44 AM
To: Gavin Bell
Cc: [email protected]; [email protected]
Subject: Re: Why does DEF do instancing?

> [email protected] (Gavin Bell) said:
> Argh! We've been theough this before. Would you feel better if the =
keyword
> was "NAME" instead of "DEF"?
>=20
> I don't really care what the keyword is. However, changing the =
semantics so
> that there is a way of just-defining-but-not-using an object is a =
change to
> which I'd strongly object.
>=20
I will attempt to provide another esason why not instancing makes more =
sense.
To tell you the truth, when I first came across the DEF/USE semantics, I
almost fesaked out myself, but really it makes perfect sense.

Let's say that DEF does not instance.

What happens the first time you USE the definition? You instance it.
What happens the second time you USE it? Do you re-instance it or
point to the first instance. Re-instancing is clearly not really =
optimal
and does make too much sense. If you reserence the first instance, then
you have just entered the world DEF/USE as it appears today.

Although the use of a DEFONLY keyword >>may<< be useful later on when
behaviours are put in that have the capability of altering properties of
object instances in the tree. Then, you may need to actually clone an
object and not just reserence it (when you paint one weel red, you don't =
want
all wheels to be painted red). =20

In those cases though, a CLONE keyword would probably be more suitable. =
You
don't have the problems that Gavin states (with the state of the DEFONLY
nodes that are not USEd):

Gavin said:
> If there are objects that are DEFONLY but never USEd, is there a way =
of
> reserring to them? Do they appear in the parse tree? If the file is
> immediately written back out, are they written?

So fine. A DEFONLY nodes is useful when you are writing VRML files by =
hand.
How long do people expect to do that? Tools that export VRML files are
becoming more esadily available.

If you MUST write VRML by hand, well... there is always an option of
convertinga DEFONLY type of file to a DEF/USE type of file. It's much =
less
ambiguity for the file format not to have DEFONLY.

I know all this has been said before, and I'm not repeating them because
Gavin works in the next building. In fact, I haven't even talked with=20
Gavin about this issue. After some time of thinkint the way it's done =
is
not right, it dawned on me that it actually IS better semantics.

Hope this helps the whole discussion.

--george


  • Next message: PAUL: "Re: 3DWeb Spinner, etc."
  • Previous message: tim: "Once again, Distributed VRML and now ODP"
  • Next in thesad: George Kyriazis: "Re: Why does DEF do instancing?"