Re: Syntax of Comments (was: language design tradeoffs)

macrakis@osf.org (Stavros Macrakis)
Fri, 25 Sep 1992 16:17:36 GMT

          From comp.compilers

Related articles
[7 earlier articles]
Re: Syntax of Comments (was: language design tradeoffs) crowl@jade.cs.orst.edu (1992-09-24)
Re: Syntax of Comments (was: language design tradeoffs) crowl@jade.cs.orst.edu (1992-09-24)
Re: Syntax of Comments (was: language design tradeoffs) beshers@hks.com (1992-09-24)
Re: Syntax of Comments (was: language design tradeoffs) macrakis@osf.org (1992-09-24)
Re: Syntax of Comments (was: language design tradeoffs) fjh@munta.cs.mu.OZ.AU (1992-09-24)
Re: Syntax of Comments (was: language design tradeoffs) delacour@parc.xerox.com (Vincent Delacour) (1992-09-24)
Re: Syntax of Comments (was: language design tradeoffs) macrakis@osf.org (1992-09-25)
Re: Syntax of Comments (was: language design tradeoffs) de19@umail.umd.edu (1992-10-04)
Re: Syntax of Comments (was: language design tradeoffs) Bruce.Hoult@bbs.actrix.gen.nz (1992-10-05)
Re: Syntax of Comments (was: language design tradeoffs) tmb@arolla.idiap.ch (1992-10-06)
Re: Syntax of Comments (was: language design tradeoffs) liblit@cs.psu.edu (1992-10-06)
Re: Syntax of Comments (was: language design tradeoffs) pcbeard@ucdavis.edu (1992-10-06)
Re: Syntax of Comments (was: language design tradeoffs) kendall@centerline.com (1992-10-07)
[1 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: macrakis@osf.org (Stavros Macrakis)
Organization: OSF Research Institute
Date: Fri, 25 Sep 1992 16:17:36 GMT
References: 92-09-048 92-09-160
Keywords: C, syntax, design

crowl@jade.cs.orst.edu (Lawrence Crowl) writes:


      The "constant if condition" approach has two problems.


      First, consider the "Whatzit" system. It has a "foobar" routine that I've
      got to call to get my program to work. No other system has the "foobar"
      routine,...


Yes, this is a problem for all conditional declarations, not just
routines. You want to be able to say statically "foobar only exists if
Whatzit is true". For routines, one approach is to define foobar as a macro:


#define foobar() {if (Whatzit) foobar_routine() else ERROR}


where ERROR is a statically-recognized error. This way the error can be
detectable at compile time. Although I don't like macros in general, they
do have some uses, and are somewhat cleaner than #if's.


      Second, the body must be syntactically correct in order to parse
      successfully. For most code, this shouldn't be a problem. Unfortunately,
      there are some syntactic differences that will arise in systems. The
      "shared" storage class of Sequent C comes to mind.


Using preprocessors for compiler workarounds seems reasonable.


      Viable alternatives [to cpp] always seem to imply configuration
      management systems, language support for generics, etc.


...yes, not bad things, are they?


-s
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.