From -7642112110086999809
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,a96d3826c7356af2
X-Google-Attributes: gidf78e5,public
From: dacut@henry.ece.cmu.edu (David A. Cuthbert)
Subject: Semantic-context keywords (was Re: Global "if" statement?)
Date: 1997/05/05
Message-ID: <5kl75e$mbn@fs7.ece.cmu.edu>#1/1
X-Deja-AN: 239590610
References: <3366E8FF.3E38@ix.netcom.com> <5kb7if$b6q@fs7.ece.cmu.edu> <5kfha7$1s9@mulga.cs.mu.OZ.AU>
X-Original-Date: 5 May 1997 17:59:10 GMT
Organization: Electrical & Computer Engineering, Carnegie Mellon University
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBM25Zj0y4NqrwXLNJAQEeCwH8CDW3mhmA2ttkcx6ejCNMEnJ2YEDJpBuP exfIR/7cZiOCOZ9JJcqY6n+jSON4ntXx+mi0LPfNQ/65Ac0akyQv5w== =Uiel
Reply-To: dacut@henry.ece.cmu.edu
Newsgroups: comp.std.c++
Originator: austern@isolde.mti.sgi.com



Fergus Henderson <fjh@mundook.cs.mu.OZ.AU> wrote:
>OK, so how about conditional declarations using the conditional-expression
>syntax (`... ? ... : ...')?

Amusing.  :-)  Tossed it into my compiler, which complained about
wanting to see ')' when it encountered '?', which I assume means that
it was expecting a typedef to a pointer-to-function.

Which brings me to another question:  what are the guidelines that the
C++ committee followed concering syntax parsers?  Would it have
complicated compilers much if certain keywords were reserved only in
specific contexts?  Consider an alternate form of declaring a const
virtual method:

int  myMethod(int, char)  is(const, virtual);

That is, create a new keyword, "is," and allow virtual to be used like
any other variable outside of the is() directive.

No, I'm not proposing this for C++; just curious as to the issues
involved.
-- 
David A. Cuthbert (henry.ece.cmu.edu!dacut)
Graduate Student, Electrical and Computer Engineering
Data Storage Systems Center, Carnegie Mellon University
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]



