:: Re: [DNG] OT: Algol w, 68, Pascal, …
Góra strony
Delete this message
Reply to this message
Autor: Adam Borowski
Data:  
Dla: dng
Temat: Re: [DNG] OT: Algol w, 68, Pascal, Ada
On Tue, Jul 05, 2016 at 04:23:39PM -0400, Hendrik Boom wrote:
> >     So let's say these languages share a few typical features: instructions
> > go across lines and they terminate with ';' (introduced by Algol60 I think),
> > they use ':=' for the assignment instruction, they use the same words to
> > denote basic types (Boolean, Integer, Natural), and they're wordy.


:= isn't that bad an idea. Heck, adding it to C17 could work -- C syntax is
not set in stone, just like it imported // comments from C++.

> And the now so-called Pascal-like languages sharply distinguish
> between expressions and statements. Statements cannot appear within
> expresssions. This is purely a syntactic restriction, because it's OK
> for an expression to call a procedure that contains statements.


I'm annoyed that C disallows:
    if (foo)
        bar, break;
On the other hand, for most statements this works:
    return fprintf(stderr, "meow\n"), 1;
or even (in a void function)
    return fprintf(stderr, "meow\n"), (void)0;


--
An imaginary friend squared is a real enemy.