Re: gnu extensions
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Tue, 25 Apr 2006 09:53:25 GMT
Ben C <spamspam@xxxxxxxxx> writes:
["Followup-To:" header set to comp.programming.]
No, you set it to comp.lang.c.
On 2006-04-24, CBFalconer <cbfalconer@xxxxxxxxx> wrote:
Richard Tobin wrote:
CBFalconer <cbfalconer@xxxxxxxxxxxxx> wrote:
The aim, from a linguistic viewpoint, should be that there is
exactly one way of achieving any desired goal, and that that way
should be fairly obvious.
"The aim"? Whose aim? It's certainly not a generally accepted aim
among programming language designers.
As an example, consider the pain and anguish to newbies caused by
the C practice of passing arrays as a pointer to the first
element. This means that the parameter may be:
T *array
or
T[]
equally well (in the parameter header). This won't get changed,
nor am I recommending such. However a better language design would
provide only one such means.
Isn't the reason for this at least partly so you can write things like
this:
typedef int arr_t[3];
void f(arr_t a)
{
...
}
I don't think so. I'm fairly sure the use of [] for pointer
parameters predates the existence of typedef.
In fact, I think one of C's predecessors (B? BCPL?) used [] even for
pointer object declarations:
int p[]; /* declares ptr as a pointer to int */
although I agree it's pretty confusing. I tend to avoid array typedefs
myself.
Yup.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- References:
- pruning a linear singly linked list
- From: Anando
- Re: gnu extensions
- From: Ben C
- pruning a linear singly linked list
- Prev by Date: Re: Binary files /DELETE/
- Next by Date: 64 bit register manipuate using 1ULL << (a) macro?
- Previous by thread: Re: gnu extensions
- Next by thread: UnicodeQuery
- Index(es):
Relevant Pages
|