From 6594954095162833127
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ede379f5dbbc1549
X-Google-Attributes: gidf78e5,public
From: Jaakko =?iso-8859-1?Q?J=E4rvi?= <jaakko.jarvi@cs.utu.fi>
Subject: Re: Suggestion: "typeof" keyword
Date: 1999/08/10
Message-ID: <37AFAC37.6B7F4253@cs.utu.fi>#1/1
X-Deja-AN: 511118147
Content-Transfer-Encoding: 8bit
Approved: Valentin Bonnard <bonnard@clipper.ens.fr>
References: <7nt3vl$1oe$1@nnrp1.deja.com> <7oh7o8$t3f$1@nnrp1.deja.com> <37AE541B.A998F729@cs.utu.fi> <cTqioZABDwr3EwfO@robinton.demon.co.uk>
X-Original-Date: Tue, 10 Aug 1999 07:36:07 +0300
X-Accept-Language: en
Content-Type: text/plain; charset=iso-8859-1
Organization: Turku Centre for Computer Science
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUAN7BcBawEuYhIxRhxAQFo5gH/Zkz8Bv6zIOkwdzsDvV7w7KqHgh/XMtJm bhrUTmi6QRlnZF0xUFRg+GZ18Lhbbx7hZczSRu2V9bfXrmCPiRxdBA== =xFWo
Mime-Version: 1.0
Newsgroups: comp.std.c++

Francis Glassborow wrote:
> 
> with typeof you do not need declare, however declare would not provide
> all the utility of typeof, and is less clear in intent.

I agree, that declare would not provide all the utility of typeof,
but I still think it would be useful (in addition to typeof).

See my example:
> typeof(a*b+c*d+e/f) x = a*b+c*d+e/f;
vs. 
> declare x = a*b+c*d+e/f;
I find the first line less clear in intent.

If we had typeof, declare could be implemented as a macro (with
different syntax though):

#define DECLARE(VAR,EXPR) typeof(EXPR) VAR = EXPR

Consequently, the implementation should be 
more or less straightforward.

/Jaakko
-- 
--- Jaakko Jdrvi, jaakko.jarvi@cs.utu.fi
--- Turku Centre for Computer Science (www.tucs.fi)
--- Lemminkdisenkatu 14 A, FIN-20520 Turku, Finland
--- Phone: +358-2-333 8656, Fax: +358-2-333 8600
---
[ 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              ]



