Re: do { quit; } else { }

Liste des GroupesRevenir à cl c  
Sujet : Re: do { quit; } else { }
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.c
Date : 08. Apr 2025, 09:12:22
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vt2lp6$1qtjd$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 07/04/2025 20:31, bart wrote:
On 07/04/2025 19:02, Michael S wrote:
On Mon, 07 Apr 2025 05:45:19 -0700

Of course, proposals for similar feature in other procedural/imperative
language would not be totally different. Pascal is more similar to C
than many other procedural languages, so solution for Pascal would
likely be more similar to C than for example, stackless co-routines
that already exist in such languages like C# (that started current wave
of popularity of the feature) or Python.
However Pascal and C have enough not in common for significant
difference in proposed syntax and implementation. Specifically, in
Pascal:
- heap management is built-n in the language
- non-local goto is built-n in the language
 That's news to me. But then I only used an educational version.
 
- nested procedures
- everything related to separated compilation of the translation units
is handwaved in the docs rather than strictly specified.
 I don't think it's that strictly specified in C. Isn't it vaguely left to the implementation?
 
No.

Much of how different units share macros, types, structs and enums isn't part of the language at all AFAICS: it's just a by-product of different modules happening to include the same header files.
 
Linkage is explained in 6.2.2 - only identifiers with external linkage are shared amongst translation units.  Macros, types, enums are all have no linkage and are therefore never shared.
The only way to make new non-standard types in C is with "struct", "union" or "enum".  Section 6.2.7 of the standard sets out simply and clearly what is required for two types in different translation units to be compatible.  (It doesn't make sense to say they are the "same type" in C lingo, since types have no linkage, but compatibility is the important point.)
Sharing a definition in a header file is normally the easiest way to ensure that the types used in different translation files are compatible, but it is not required.

But it could also be done by repeating declarations in each module; it's rather ad hoc.
It is not remotely "ad hoc" - as far as the language is concerned, including a header file /is/ repeating the declaration in the different translation units.  The way C handles this kind of thing is arguably weaker than in languages that have proper modules (like Ada, or Modula 2), and much more open to mistakes.  On the other hand, it is very flexible and simple to understand, and does not need additional specialised object files or "interface" files.  It is possible to write C code in an "ad hoc" manner (such as declaring an "extern" identifier within a C file rather than a header file), but the language definition is not "ad hoc".

 The Pascal I used only worked with one module; more recent versions do seem to have formal interfaces which are part of the language. So it is more rigorous than C.
 
Yes, most Pascal versions suitable for real development (rather than the older teaching versions) have more formal interfaces.  Personally, I prefer more formal interfaces - more formality and stronger typing reduce flexibility but also reduce the risk of some kinds of errors, and can make a language more amenable to analysis.

 
May be it's
not so in Extended Pascal standard, I never read it.
>
Most importantly, Pascal in its hay days had different (from C)
attitude with regard to standardization. Implementors, especially
bigger ones, freely made very significant mutually incompatible
extensions and nobody in community was upset about it. C way is more
centralized.
 I have a feeling that there were WAY more variations of C than Pascal, largely because C was more popular and more widespread.
 
I suspect you are wrong here.  There are certainly far more C compilers than Pascal compilers, and there are minor variations between the C compilers, but even prior to K&R's book the differences between C compilers was smaller than between the different Pascal versions. Pascal was standardised, but standard Pascal was too limited for most commercial use and different vendors build on it - with Borland's line being the most relevant.  Comparing modern Delphi and standard Pascal is a bit like comparing C# with K&R C.

You still see this know when you delve into systems and applications headers which are often a mess of '#ifdef' blocks which special-case specific compiler versions which all have different characteristics.
 
Certainly there are variations in the details - in particular, there are lots of things in C (and Pascal) that are "implementation defined".
It is the similarity between C compilers that means that often all you need is some #ifdef's for low-level or library code shared between C compilers on significantly different systems or targets.  If you want to write a low-level library for Free Pascal, Delphi, GNU Pascal, and Pascal-P, you write four versions of it.

Date Sujet#  Auteur
4 Apr 25 * do { quit; } else { }312Thiago Adams
4 Apr 25 +* Re: do { quit; } else { }2bart
4 Apr 25 i`- Re: do { quit; } else { }1Thiago Adams
4 Apr 25 +* Re: do { quit; } else { }11Kaz Kylheku
4 Apr 25 i+* Re: do { quit; } else { }3Thiago Adams
4 Apr 25 ii`* Re: do { quit; } else { }2Kaz Kylheku
4 Apr 25 ii `- Re: do { quit; } else { }1Chris M. Thomasson
4 Apr 25 i+* Re: do { quit; } else { }4Kaz Kylheku
4 Apr 25 ii+* Re: do { quit; } else { }2Thiago Adams
4 Apr 25 iii`- Re: do { quit; } else { }1Thiago Adams
8 Apr 25 ii`- Re: do { quit; } else { }1candycanearter07
5 Apr 25 i`* Re: do { quit; } else { }3Janis Papanagnou
5 Apr 25 i +- Re: do { quit; } else { }1Janis Papanagnou
6 Apr 25 i `- Re: do { quit; } else { }1Michael S
4 Apr 25 +* Re: do { quit; } else { }296Tim Rentsch
4 Apr 25 i`* Re: do { quit; } else { }295Thiago Adams
6 Apr 25 i `* Re: do { quit; } else { }294Tim Rentsch
6 Apr 25 i  +* Re: do { quit; } else { }276Michael S
6 Apr 25 i  i`* Re: do { quit; } else { }275Tim Rentsch
6 Apr 25 i  i `* Re: do { quit; } else { }274Michael S
7 Apr 25 i  i  `* Re: do { quit; } else { }273Tim Rentsch
7 Apr 25 i  i   `* Re: do { quit; } else { }272Michael S
7 Apr 25 i  i    +* Re: do { quit; } else { }268bart
8 Apr 25 i  i    i`* Re: do { quit; } else { }267David Brown
8 Apr 25 i  i    i `* Re: do { quit; } else { }266bart
8 Apr 25 i  i    i  +* Re: do { quit; } else { }261David Brown
8 Apr 25 i  i    i  i`* Re: do { quit; } else { }260bart
8 Apr 25 i  i    i  i +* Re: do { quit; } else { }58Tim Rentsch
8 Apr 25 i  i    i  i i`* Re: do { quit; } else { }57bart
8 Apr 25 i  i    i  i i +* Re: do { quit; } else { }54Tim Rentsch
8 Apr 25 i  i    i  i i i`* Re: do { quit; } else { }53bart
9 Apr 25 i  i    i  i i i `* Re: do { quit; } else { }52Tim Rentsch
9 Apr 25 i  i    i  i i i  `* Re: do { quit; } else { }51bart
9 Apr 25 i  i    i  i i i   +- Re: do { quit; } else { }1Chris M. Thomasson
9 Apr 25 i  i    i  i i i   +- Re: do { quit; } else { }1Chris M. Thomasson
9 Apr 25 i  i    i  i i i   `* Re: do { quit; } else { }48Tim Rentsch
10 Apr 25 i  i    i  i i i    `* Re: do { quit; } else { }47bart
10 Apr 25 i  i    i  i i i     +* Re: do { quit; } else { }45Kaz Kylheku
10 Apr 25 i  i    i  i i i     i+* Re: do { quit; } else { }2Michael S
10 Apr 25 i  i    i  i i i     ii`- Re: do { quit; } else { }1Kaz Kylheku
10 Apr 25 i  i    i  i i i     i`* Re: do { quit; } else { }42bart
10 Apr 25 i  i    i  i i i     i +* Re: do { quit; } else { }28Keith Thompson
10 Apr 25 i  i    i  i i i     i i`* Re: do { quit; } else { }27bart
10 Apr 25 i  i    i  i i i     i i +* Re: Endless complaints [was Re: do { quit; } else { }]16bart
10 Apr 25 i  i    i  i i i     i i i+* Re: Endless complaints [was Re: do { quit; } else { }]14Janis Papanagnou
11 Apr 25 i  i    i  i i i     i i ii`* Re: Endless complaints [was Re: do { quit; } else { }]13bart
11 Apr 25 i  i    i  i i i     i i ii +- Re: Endless complaints [was Re: do { quit; } else { }]1Keith Thompson
11 Apr 25 i  i    i  i i i     i i ii +- Re: Endless complaints [was Re: do { quit; } else { }]1Kaz Kylheku
11 Apr 25 i  i    i  i i i     i i ii `* Re: Endless complaints [was Re: do { quit; } else { }]10David Brown
11 Apr 25 i  i    i  i i i     i i ii  `* Re: Endless complaints [was Re: do { quit; } else { }]9bart
11 Apr 25 i  i    i  i i i     i i ii   +* Re: Endless complaints [was Re: do { quit; } else { }]5Michael S
11 Apr 25 i  i    i  i i i     i i ii   i`* Re: Endless complaints [was Re: do { quit; } else { }]4bart
11 Apr 25 i  i    i  i i i     i i ii   i `* Re: Endless complaints [was Re: do { quit; } else { }]3Michael S
11 Apr 25 i  i    i  i i i     i i ii   i  +- Re: Endless complaints [was Re: do { quit; } else { }]1Janis Papanagnou
11 Apr 25 i  i    i  i i i     i i ii   i  `- Re: Endless complaints [was Re: do { quit; } else { }]1bart
11 Apr 25 i  i    i  i i i     i i ii   +- Re: Endless complaints [was Re: do { quit; } else { }]1David Brown
11 Apr 25 i  i    i  i i i     i i ii   +- Re: Endless complaints1Tim Rentsch
11 Apr 25 i  i    i  i i i     i i ii   `- Re: Endless complaints [was Re: do { quit; } else { }]1Keith Thompson
10 Apr 25 i  i    i  i i i     i i i`- Re: Endless complaints [was Re: do { quit; } else { }]1Keith Thompson
10 Apr 25 i  i    i  i i i     i i `* Re: do { quit; } else { }10Keith Thompson
11 Apr 25 i  i    i  i i i     i i  `* Re: do { quit; } else { }9bart
11 Apr 25 i  i    i  i i i     i i   `* Re: do { quit; } else { }8Keith Thompson
11 Apr 25 i  i    i  i i i     i i    `* Re: do { quit; } else { }7Michael S
11 Apr 25 i  i    i  i i i     i i     +- Re: do { quit; } else { }1David Brown
11 Apr 25 i  i    i  i i i     i i     +* Re: do { quit; } else { }4Kaz Kylheku
11 Apr 25 i  i    i  i i i     i i     i+* Re: do { quit; } else { }2bart
11 Apr 25 i  i    i  i i i     i i     ii`- Re: do { quit; } else { }1Keith Thompson
13 Apr18:45 i  i    i  i i i     i i     i`- Re: do { quit; } else { }1Michael S
11 Apr 25 i  i    i  i i i     i i     `- Re: do { quit; } else { }1Keith Thompson
10 Apr 25 i  i    i  i i i     i `* Re: do { quit; } else { }13Kaz Kylheku
10 Apr 25 i  i    i  i i i     i  +* Re: do { quit; } else { }10bart
10 Apr 25 i  i    i  i i i     i  i+* Re: do { quit; } else { }2Kaz Kylheku
11 Apr 25 i  i    i  i i i     i  ii`- Re: do { quit; } else { }1bart
11 Apr 25 i  i    i  i i i     i  i+* Re: do { quit; } else { }5Tim Rentsch
11 Apr 25 i  i    i  i i i     i  ii`* Re: do { quit; } else { }4Keith Thompson
11 Apr 25 i  i    i  i i i     i  ii `* Re: do { quit; } else { }3Tim Rentsch
11 Apr 25 i  i    i  i i i     i  ii  `* Re: do { quit; } else { }2Keith Thompson
11 Apr 25 i  i    i  i i i     i  ii   `- Re: do { quit; } else { }1bart
11 Apr 25 i  i    i  i i i     i  i+- Re: do { quit; } else { }1Keith Thompson
11 Apr 25 i  i    i  i i i     i  i`- Re: do { quit; } else { }1Keith Thompson
10 Apr 25 i  i    i  i i i     i  +- Re: do { quit; } else { }1bart
10 Apr 25 i  i    i  i i i     i  `- Re: do { quit; } else { }1Kaz Kylheku
11 Apr 25 i  i    i  i i i     `- Re: do { quit; } else { }1Tim Rentsch
9 Apr 25 i  i    i  i i +- Re: do { quit; } else { }1Richard Damon
9 Apr 25 i  i    i  i i `- Re: do { quit; } else { }1David Brown
9 Apr 25 i  i    i  i `* Re: do { quit; } else { }201David Brown
9 Apr 25 i  i    i  i  +* Re: do { quit; } else { }3Michael S
9 Apr 25 i  i    i  i  i+- Re: do { quit; } else { }1David Brown
11 Apr 25 i  i    i  i  i`- Re: do { quit; } else { }1James Kuyper
9 Apr 25 i  i    i  i  +* Re: do { quit; } else { }2Michael S
9 Apr 25 i  i    i  i  i`- Re: do { quit; } else { }1David Brown
9 Apr 25 i  i    i  i  +* Re: do { quit; } else { }2Michael S
9 Apr 25 i  i    i  i  i`- Re: do { quit; } else { }1David Brown
9 Apr 25 i  i    i  i  +* Re: do { quit; } else { }7bart
9 Apr 25 i  i    i  i  i`* Re: do { quit; } else { }6David Brown
9 Apr 25 i  i    i  i  i `* Re: do { quit; } else { }5bart
9 Apr 25 i  i    i  i  i  +* Re: do { quit; } else { }2David Brown
9 Apr 25 i  i    i  i  i  i`- Re: do { quit; } else { }1bart
11 Apr 25 i  i    i  i  i  `* Re: do { quit; } else { }2James Kuyper
11 Apr 25 i  i    i  i  i   `- Re: do { quit; } else { }1James Kuyper
9 Apr 25 i  i    i  i  `* Re: do { quit; } else { }186Janis Papanagnou
8 Apr 25 i  i    i  +- Re: do { quit; } else { }1Tim Rentsch
9 Apr 25 i  i    i  `* Re: do { quit; } else { }3Ike Naar
8 Apr 25 i  i    `* Re: do { quit; } else { }3Tim Rentsch
6 Apr 25 i  `* Re: do { quit; } else { }17Michael S
6 Apr 25 +- Re: do { quit; } else { }1Lawrence D'Oliveiro
6 Apr 25 `- Re: do { quit; } else { }1David Brown

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal