From -6367120516854307417
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ede379f5dbbc1549
X-Google-Attributes: gidf78e5,public
From: Max TenEyck Woodbury <mtew@cds.duke.edu>
Subject: Re: Suggestion: "typeof" keyword
Date: 1999/08/17
Message-ID: <37B98342.83E701F3@cds.duke.edu>#1/1
X-Deja-AN: 513838651
Content-Transfer-Encoding: 7bit
Approved: Valentin Bonnard <bonnard@clipper.ens.fr>
References: <7nt3vl$1oe$1@nnrp1.deja.com> <7oh7o8$t3f$1@nnrp1.deja.com> <7ol6hi$ej9$2@news.BelWue.DE> <cTiioXAhAwr3Ew$X@robinton.demon.co.uk> <t7d7ww1vrz.fsf@calumny.jyacc.com> <e4DSyfA4ALs3Ew0Q@robinton.demon.co.uk> <t7r9laz5hj.fsf@calumny.jyacc.com> <7oup0a$8g2$1@nnrp1.deja.com> <37B2E9B8.491D@wanadoo.fr> <slrn7r5tnl.kn9.sbnaran@localhost.localdomain> <37B43D99.608A@wanadoo.fr> <7pa195$prj$1@nnrp1.deja.com>
X-Original-Date: Tue, 17 Aug 1999 11:44:02 -0400
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Duke University, Durham, NC, USA
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUAN7mD66wEuYhIxRhxAQFYbAIAjXciESfK+wh/qK14u1NRB6mMT+s41v1K bkcX/USHoANK5n1McCP9kGryWgwOh2tooEQFc7+echTSGSutIjinnA== =AhPA
Mime-Version: 1.0
Newsgroups: comp.std.c++

sirwillard@my-deja.com wrote:
> 
> Not so crystal clear.  The first thing that must be decided is
> if 'typeof' performs static typing or runtime typing.  Seems people
> don't agree on this one within this thread.  This is why I brought the
> subject up... not because we can't come to a conclusion and define
> proper semantics for it, but because the proper semantics have to be
> defined in order to make a proposal.

As originally proposed, typeof was the same kind of compiler construct
as sizeof. C's extension of sizeof to have a run-time component was not
then in train.

With that historical context, I think it is clear that typeof should
not have any run-time magic associated with it. That kind of magic belongs
to casts and typeid. The main reason for this is that types (as opposed
to instances) do not exist at run-time. Extending typeof to have a
run-time component would blur this semantic distinction.

mtew@cds.duke.edu
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]



