Deutsch English Français Italiano |
<85cydtj5lb.fsf@nosuchdomain.example.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Keith Thompson <Keith.S.Thompson+u@gmail.com> Newsgroups: comp.lang.c Subject: Re: "A diagram of C23 basic types" Date: Thu, 03 Apr 2025 14:30:24 -0700 Organization: None to speak of Lines: 57 Message-ID: <85cydtj5lb.fsf@nosuchdomain.example.com> References: <87y0wjaysg.fsf@gmail.com> <vsj1m8$1f8h2$1@dont-email.me> <vsj2l9$1j0as$1@dont-email.me> <vsjef3$1u4nk$1@dont-email.me> <vsjg6t$20pdb$1@dont-email.me> <vsjgjn$1v1n4$1@dont-email.me> <vsjk4k$24q5m$1@dont-email.me> <vsjlcp$230a5$1@dont-email.me> <vsjmdl$277bk$1@dont-email.me> <VsdHP.1828827$TBhc.1078002@fx16.iad> <vskjlo$34st8$1@dont-email.me> <20250402220614.431@kylheku.com> <85mscxlqnb.fsf@nosuchdomain.example.com> <vsl9sn$3vdjj$2@dont-email.me> <20250403121946.134@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Thu, 03 Apr 2025 23:30:29 +0200 (CEST) Injection-Info: dont-email.me; posting-host="658736fab9029f452335cecd036b8387"; logging-data="1777637"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yUDQNZgEsBwOR+gjbNLwu" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:OHowEinXMaBUEvBnBZtIup/tKuE= sha1:w8z01qBj3waDf8Mnf4sAeBlDiBc= Bytes: 3504 Kaz Kylheku <643-408-1753@kylheku.com> writes: [...] > One programming language that has comma separators is Fortran, > by the way. Fortran persisted in providing this feature in spite of > shooting itself in the foot with ambiguities. > > When Fortran was being designed, people were naive in writing > compilers. They thought that it would simplify things if they > removed all spaces from the code before lexically scanning it and > parsing. > > Thus "DO I = 1, 10" becomes "DOI=1,10" and "FO I = 1, 10" > becomes "FOI=1,10" > > After that you have to figure out that "DOI=1,10" is the > header of a DO loop which steps I from 1 to 10, > whereas "FOI=1,10" assigns 110 to variable FOI. I don't think that's correct. My quick experiments with gfortran indicate that commas are *not* treated as digit separators. The classic Fortran (or FORTRAN?) error was that: DO 10 I = 1,100 (a loop with bounds 1 to 100) was written as: DO 10 I = 1.100 (which assigns the value 1.100 to the variable DO10I). An urban legend says that this error caused the loss of a spacecraft. In fact the error was caught and corrected before launch. [...] > Commas are "fluff punctuators". They could be removed without > making a difference to the abstract syntax. > > Fun fact: early Lisp (when it was called LISP) had commas > in lists. They were optional. (1, 2, 3) or (1 2 3). Your > choice. > > Comma separation causes problems when arguments can be empty! > > In C preprocessing MAC() is actually a macro with one argument, > which is empty. MAC(,) is a macro with two empty arguments > and so on. You cannot write a macro call with zero arguments. > > Now, if macros didn't use commas, there wouldn't be a problem > at all: MAC() -> zero args; MAC(abc) -> one arg; > MAC(abc 2) -> two args. > > Wow, consistency. And no dangling comma nonsense to deal with in > complex, variadic macros! Would MAC("foo" "bar") have one argument or two? -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */