From -5775785288498874643
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ede379f5dbbc1549
X-Google-Attributes: gidf78e5,public
From: sbnaran@uiuc.edu (Siemel B. Naran)
Subject: Re: Suggestion: "typeof" keyword
Date: 1999/08/16
Message-ID: <slrn7rbkr7.dom.sbnaran@localhost.localdomain>#1/1
X-Deja-AN: 513421655
X-NNTP-Posting-Host: istanbul-14.slip.uiuc.edu
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <7nt3vl$1oe$1@nnrp1.deja.com> <7oh7o8$t3f$1@nnrp1.deja.com> <37AE541B.A998F729@cs.utu.fi> <cTqioZABDwr3EwfO@robinton.demon.co.uk> <37AFAC37.6B7F4253@cs.utu.fi> <7opt86$pku$1@nnrp1.deja.com> <37B46035.CFD0324E@physik.tu-muenchen.de>
X-UID: 0000000001
X-Status: $$$T
Organization: University of Illinois at Urbana-Champaign
User-Agent: slrn/0.9.5.7 (UNIX)
Reply-To: sbnaran@uiuc.edu
Newsgroups: comp.std.c++
Originator: clamage@taumet


On 14 Aug 99 08:23:16 GMT, Christopher Eltschka
 
>  typeof(sin(x)/x + tan(x)*exp(-3*x*x))
>    expr = sin(x)/x + tan(x)*exp(-3*x*x);

>  declare expr = sin(x)/x + tan(x)*exp(-3*x*x);


Can you think of a keyword other than 'declare'?
It is highly possible that people have variables named 'declare'!

To reduce the negative feeling about inventing a whole new keyword
for what really is a trivial feature, can you think of new name for
the keyword or a more general macro feature?  Here are two
possibilities:

First
   auto typeof expr = sin(x)/x + tan(x)*exp(-3*x*x);

Or
   #define->  how    sin(x)/x + tan(x)*exp(-3*x*x)
   typeof(how) expr(how); 'how' available only to this line
   typeof(how) error(how); // error: 'how' undefined

-- 
----------------------------------
Siemel B. Naran (sbnaran@uiuc.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              ]




