array

M

Mark McIntyre

Yes, it would have been clearer. It would also have been correct,
which your original statement quite simply was not.

My original statement was absolutely correct, An array is a derived
type.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
G

Guest

You claimed that array assignment /has/ to be disallowed, because
arrays are derived types. Yevgen Muntyan's example disproved this.

No I didn't. I said that an array was a derived type, not a simple
type and has different behaviour.

***********>Mark McIntyre said:
On 8 Mar 2007 11:01:30 -0800, in comp.lang.c , (e-mail address removed)
wrote: [un-snip start]
why? what's the reason? why array's cant be like any other type in C?
why it have to be different?
[un-snip end]

***********

You snipped too much. You claimed that an array isn't a type, and that
that is the reason it has to be different. If others don't read your
reply as an answer to the question (as "Because an array isn't a
type.") though, I'll admit I'm wrong on that part.
(snippage)



My point was that derived types have different behaviour to simple
types, and so you cannot assume that simple assignment will be
possible. I gave an example showing how you cannot assign to a struct
using a method that other languages support, and indeed C allows you
to use to /initialise/ a struct (and indeed an array).

And I showed that you /can/ assign to a struct using that same method.
The syntax is different from initialisation, but I also showed that
the syntax for initialising and assigning to basic types
(specifically, int) differs as well, so how did you read that as a
difference between structures and basic types?
 
D

Default User

Richard said:
Default User said:


Yeah. What he might not realise from reading Google's help pages is
that newsgroups are not a Google product, but a well-established
on-line society to which Google has attached itself like a remora.

Did you actually READ the link I provided?

"What is a Usenet Newsgroup?

Usenet is an online bulletin board system that began at Duke University
in 1979. Usenet users can post messages to newsgroups that can be read
(and responded to) by anyone who has access to the system through a
newsreader. Over the years, the number of newsgroups has grown into the
thousands, hosted all over the world and covering every conceivable
topic.

Google Groups contains the world's most comprehensive archive of Usenet
postings, dating back to 1981. Google Groups eliminates the need for a
newsreader and lets you search this archive the same way you'd search
on the web. You can also use Google Groups to post your own comments to
an existing Usenet newsgroup."
Nor will he learn that Google behaves irresponsibly by refusing to
clamp down on Usenet abuse perpetrated via their servers.

That's a different story.



Brian
 
B

Ben Pfaff

Mark McIntyre said:
My original statement was absolutely correct, An array is a derived
type.

That part of your original statement, in the second sentence, was
correct (except for the grammatical error of "its"). The problem
was with the first sentence. Here, let me present it again:
 
M

Mark McIntyre

You snipped too much. You claimed that an array isn't a type, and that
that is the reason it has to be different.

You apparently mentally snipped too much, for the distinction I was
drawing was between a simple and derived type.
And I showed that you /can/ assign to a struct using that same method.

So what? As I've said ad nauseam, you can't prove it by example, only
disprove by counterexample.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
M

Mark McIntyre

That part of your original statement, in the second sentence, was
correct (except for the grammatical error of "its"). The problem
was with the first sentence. Here, let me present it again:

Feel free, I've done so myself elsethread.

Clearly people are harder of reading than I thought. The distinction
I'm making is between a simple and derived type.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
B

Ben Pfaff

Mark McIntyre said:
Clearly people are harder of reading than I thought. The distinction
I'm making is between a simple and derived type.

OK. In the future please try to make it clear by saying "An
array isn't a simple type" then.
 
R

Richard Heathfield

Mark McIntyre said:
Feel free, I've done so myself elsethread.


Clearly people are harder of reading than I thought. The distinction
I'm making is between a simple and derived type.

Nevertheless, the way in which you drew that distinction is flawed, and
that's all that your correspondents seem to be claiming.

If an array is a derived type, then it is a type, and yet you claimed:
"An array isn't a type." Clearly, you understand that it /is/ in fact a
type, so presumably you will understand and agree that the sentence I
just quoted is incorrect.
 
Y

Yevgen Muntyan

Mark said:
You apparently mentally snipped too much, for the distinction I was
drawing was between a simple and derived type.


So what? As I've said ad nauseam, you can't prove it by example, only
disprove by counterexample.

You mean you can't prove that assignment is possible by providing
an example of assignment; but it's possible to disprove it by providing
piece of code which isn't even C? Interesting. What does "one can
assign structures" in your world? You really need to state what you
are "proving".

Yevgen
 
D

Default User

Richard said:
Default User said:

Yes, actually. Hence "might not" rather than "will not".


There is no document that can't be misinterpreted by a sufficiently
stupid reader. The one I pointed to was clear enough in my mind for the
designated purpose.




Brian
 
K

Keith Thompson

Mark McIntyre said:
You apparently mentally snipped too much, for the distinction I was
drawing was between a simple and derived type.

That distinction is irrelevant in this case.

You claimed that array types are not types. You were wrong.
So what? As I've said ad nauseam, you can't prove it by example, only
disprove by counterexample.

Fine, forget about examples and counterexamples.

int is a non-derived type. The language supports assignment for type int.

void is a non-derived type. The language does not support assignment
for type void.

A structure type is a derived type. The language supports assignment
for structure types.

An array type is a derived type. The language does not support
assignment for array types.

Conclusion: The fact that assignment is not supported for array types
has nothing to do with the fact that array types are derived types.
You claimed that there was a relationship. You were incorrect.
 
K

Keith Thompson

Mark McIntyre said:
My original statement was absolutely correct, An array is a derived
type.

One of your original statements was that an array is a derived type.
That's absolutely correct, and nobody has claimed otherwise.

Another of your original statements was that an array is not a type.
That's wrong; an array is a type.
 
G

Guest

Mark said:
You apparently mentally snipped too much, for the distinction I was
drawing was between a simple and derived type.

You're probably confusing me with some others in this thread. I
treated "isn't a type" as "isn't a simple type" in my replies. Please
re-read my message.
So what? As I've said ad nauseam, you can't prove it by example, only
disprove by counterexample.

It disproved your claim that you cannot assign to a struct using that
same method.

What you probably meant, is that I cannot prove that it applies to /
all/ structure types using just an example. If that's not what you
meant, you're wrong.
 
C

CBFalconer

Ben said:
.... snip ...
--
"...Almost makes you wonder why Heisenberg didn't include postinc/dec
operators in the uncertainty principle. Which of course makes the
above equivalent to Schrodinger's pointer..."
--Anthony McDonald

Didn't Schroedinger kept a sealpoint cat, rather than a dog. :)

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
 
R

Richard Heathfield

Default User said:

There is no document that can't be misinterpreted by a sufficiently
stupid reader. The one I pointed to was clear enough in my mind for
the designated purpose.

Ah, but then you are not a sufficiently stupid reader!
 
D

Default User

Richard said:
Default User said:



Ah, but then you are not a sufficiently stupid reader!

The point was that the information I provided, even though it came from
Google, was pretty decent for a brief overview.




Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top