Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.std.c Subject: Re: Add @ to basic character set? Date: Mon, 07 Dec 2020 12:19:48 -0800 Organization: None to speak of Lines: 45 Message-ID: <87zh2pe5cr.fsf@nosuchdomain.example.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="8c1d1df3fcf9f83d93d1ccf626f65b8d"; logging-data="27800"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+X1B5766oYD7oMNz6Rzr+m" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cancel-Lock: sha1:CsaM2A33eOruB+mTigXwlAmzMJQ= sha1:ueLc5ybcF5DeygM6jpl00BzF/gI= Xref: csiph.com comp.std.c:6183 Thomas David Rivers writes: > Philipp Klaus Krause wrote: > >>I wonder if it would make sense to add @ to the basic character set. >>Virtually everyone is using it in comments and strings already anyway >>(for email addresses), and I don't see anything preventing >>implementations from supporting it, as it is available in both ASCII and >>common EBCDIC code pages: >> >>http://www.colecovision.eu/stuff/proposal-basic-@.html >> > Just to add to the "used as an extension" list of compilers; the Dignus > compilers (and the SAS/C compilers) for the mainframe use @ to be similar > to &, except that it can accept an rvalue. If an rvalue is present > after a @, then the address of a copy is generated. The copy is > declared within > the inner-most scope. > > This is helpful in some situations on the mainframe where pass-by-reference > is the norm, as in: > > FOO(@1, @2); > > (where FOO is defined in some other language, e.g. PL/I, where the > parameters > are pass-by-reference.) You can do the same thing with a compound literal starting in C99: #include void FOO(int *a, int *b) { printf("%d %d\n", *a, *b); } int main(void) { FOO(&(int){1}, &(int){2}); } I suspect the extension predates compound literals. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */