a doubt about c

R

Roberto Waltman

Keith said:
(Incidentally, the word "doubt" is not synonymous with "question",
at least not in most dialects of English. A "doubt" generally
implies that you disbelieve something.)

I asked once about this, (don't recall if it was in c.l.c,) and was
told that in today's English as spoken in India, "doubt" an "question"
are indeed synonyms.
 
R

Roberto Waltman

Nick said:
C++ still uses the preprocessor. What is the alternative to #include?

The "using stuff-from-other-module" directives as implemented in
several other languages

if (expression that evaluates to zero at compile time)
{
non reachable code deleted by the compiler
}
 
E

Eric Sosman

The "using stuff-from-other-module" directives as implemented in
several other languages


if (expression that evaluates to zero at compile time)
{
non reachable code deleted by the compiler
}

C's preprocessor is, of course, capable of things that cannot
be done this way, for instance

#if INT_MAX >= 1000000
typedef int Million;
#else
typedef long Million;
#endif

or

struct ByLightning {
double toil;
double trouble;
short shrift;
short snort;
#if DEBUG_LEVEL > 2
char debug_buff[1024];
#endif
};

Over the years I've seen praise for the preprocessor's ability
to do this sort of thing, and sneers at C for needing preprocessor
magic to work around its weaknesses. I'm pretty much as "C is what
it is; get over it" sort of guy, but some are less forgiving.
 
K

Keith Thompson

Roberto Waltman said:
I asked once about this, (don't recall if it was in c.l.c,) and was
told that in today's English as spoken in India, "doubt" an "question"
are indeed synonyms.

Yes, that's my understanding as well.

The point, I suppose, is that speakers of the Indian dialect of
English should be aware of this when posting to an international
forum like this one. One solution would be for them to use the word
"question" instead. And of course the rest of us also need to be
aware of the issue.

(Although I work with a number of people from India, and I don't
recall any of them ever using the word "doubt" in that way.)
 
N

Nick Keighley

Nick Keighley  wrote:

The "using stuff-from-other-module" directives as implemented in
several other languages


   if (expression that evaluates to zero at compile time)
   {
        non reachable code deleted by the compiler
   }

yet C++ that has added many things to a C base hasn't yet gone this
far. (I have to confess I thought #include was pretty ikky the first
time I met it)
 
B

Ben Pfaff

Keith Thompson said:
(Although I work with a number of people from India, and I don't
recall any of them ever using the word "doubt" in that way.)

I have known some who do. In particular, back when I was an
undergrad I remember an Indian teaching assistant who would ask
the class "any doubts?" during a lecture in place of "any
questions?".
 
R

Ralph Spitzner

Roberto said:
I asked once about this, (don't recall if it was in c.l.c,) and was
told that in today's English as spoken in India, "doubt" an "question"
are indeed synonyms.

Could be because to 'doubt' something is putting something in
question.

[Say "is this right the way it is ?"]

-rasp

Just my 0.02EUR to the term itself :p
 
S

Seebs

The western equivalent is along the lines of "I'm unsure about ...".
Again, the question is implied rather than stated explicitly.
Yes.

In its most general form, it just means that you're uncertain.
"I doubt ..." tends to specifically signify disbelief, but "I have doubts
about ..." is more on-the-fence.

Interestingly, outside of the Asian-influenced dialect, I've never seen "a
doubt" used in English. I've seen doubt used as a verb, and doubts (plural)
referred to, but I've not seen a native speaker say "a doubt".

-s
 
S

Seebs

I read some open source c program code, found a problem that let me doubt.

The word "doubt" is used, in most dialects of English, only when you have
been told something but do not believe it. It is not generally used for
other kinds of uncertainty.
All those programs are using macros to define constants, and did
not use an enum to achieve, but I think in the enumeration constants
is very convenient.
Enumeration defines constants used in c++, but not seen any in c, why?

History, mostly. Enumerations can be used for constants in C, but a
lot of people never got the habit. The C language existed before enumerated
types existed, so a lot of people picked up the convention of using macros
for constants. Also, macros can be used for non-integer constants, or
constants larger than an object of type int can hold, while enumerations
are more limited.

-s
 
J

James Kuyper

The "using stuff-from-other-module" directives as implemented in
several other languages

Which C++ doesn't have.
if (expression that evaluates to zero at compile time)
{
non reachable code deleted by the compiler
}

One of the primary uses of #if in C++ code is to control whether or not
code is actually included that would violate a diagnosable rule if the
condition of the #if were false. In C++, as currently defined, the code
which you label as "unreachable" is not required to be "deleted by the
compiler", except insofar as that deletion is covered by the as-if rule.
That rule doesn't allow the compiler to ignore violations of diagnosable
rules. If the "unreachable" code contains such violations, it must still
generate at least one diagnostic message, and it is still permitted to
refuse to translate such code, and in most cases, typical
implementations of C++ will do so.

Your suggested alternative also creates a scope not present in the
corresponding #if; this will often cause problems as a replacement for a
#if. For instance, if the if-condition is true, any identifiers declared
or defined within the if-block will have their scope restricted to that
block. This is incompatible with many uses of #if, including the example
that Eric Sosman gave.
 
J

James Kuyper

Roberto said:
I asked once about this, (don't recall if it was in c.l.c,) and was
told that in today's English as spoken in India, "doubt" an "question"
are indeed synonyms.

Could be because to 'doubt' something is putting something in
question.

[Say "is this right the way it is ?"]

That's quite probably how that usage came into existence, but the point
is, it's still incorrect usage anywhere except Indian English, as far as
I know. The number of Indians who speak Indian English as a second
language is immense, but it's the native language of only a tiny
fraction of them. They need to be aware that this is a dialect-specific
usage, and one that is likely to confuse people who don't speak that
dialect. It should be avoided in contexts, such as this one, where most
of the participants don't speak that dialect.
 
N

Nobody

if (expression that evaluates to zero at compile time)
{
non reachable code deleted by the compiler
}

C's preprocessor is, of course, capable of things that cannot
be done this way, for instance

#if INT_MAX >= 1000000
typedef int Million;
#else
typedef long Million;
#endif

or

struct ByLightning {
double toil;
double trouble;
short shrift;
short snort;
#if DEBUG_LEVEL > 2
char debug_buff[1024];
#endif
};

In C++, both of these examples could be done using templates, albeit
somewhat more verbosely.

One situation which can't be handled (entirely) by templates is:

struct Struct {
int foo;
int bar;
};

enum Fields {
foo,
bar
};

struct StructField {
int Struct::*ptr;
int id;
const char* name;
StructField(int Struct::*ptr, int id, const char* name)
: ptr(ptr), id(id), name(name) {}
};

StructField f(&Struct::foo, foo, "foo");
StructField b(&Struct::bar, bar, "bar");
// Using the preprocessor could avoid the redundant redundancy:
// STRUCT_FIELD(f, foo);
 
S

Squeamizh

Interestingly, outside of the Asian-influenced dialect, I've never seen "a
doubt" used in English.  I've seen doubt used as a verb, and doubts (plural)
referred to, but I've not seen a native speaker say "a doubt".

Maybe you're forgetting the expression "without a doubt."
 
G

Geoff

Maybe you're forgetting the expression "without a doubt."

Also, FWIW, Webster's lists "question" as a synonym of "doubt" but not
vice versa.

http://www.merriam-webster.com/dictionary/doubt

It's entirely possible the Jesuits who pioneered the Asian-European
translation efforts in the 1700's are responsible for this "doubt vs.
question" problem since the connotation of "doubt" is one of
incertitude and distrust vs the interrogative connotation of
"question" and the Spanish-French speaking Jesuits had their own
cultural biases and criteria when the references were developed.

In other words, give it up Seebs, you aren't going prevail against a
300 year old etymology.
 
J

J. J. Farrell

Geoff said:
Also, FWIW, Webster's lists "question" as a synonym of "doubt" but not
vice versa.

http://www.merriam-webster.com/dictionary/doubt

It's entirely possible the Jesuits who pioneered the Asian-European
translation efforts in the 1700's are responsible for this "doubt vs.
question" problem since the connotation of "doubt" is one of
incertitude and distrust vs the interrogative connotation of
"question" and the Spanish-French speaking Jesuits had their own
cultural biases and criteria when the references were developed.

In other words, give it up Seebs, you aren't going prevail against a
300 year old etymology.

What's to "give up"? It is not a normal usage outside "Indian" English,
to the extent that most speakers of other forms of English find it
puzzling when they first come across it. It does no harm to advise its
users that it is a usage which is not widely understood, and may do them
some good.
 
D

Dr Nick

Roberto Waltman said:
The "using stuff-from-other-module" directives as implemented in
several other languages


if (expression that evaluates to zero at compile time)
{
non reachable code deleted by the compiler
}

Like this you mean:

#if SEPARATE_FILE
#include "dostuff.c"
#else
int do_stuff(char *fred {
return strlen(fred)*3;
}
#endif
 
N

Nobody

It is not a normal usage outside "Indian" English, to the extent that
most speakers of other forms of English find it puzzling when they first
come across it.

Have you conducted a survey?

I would be surprised if many people actually didn't understand it. People
might find it unusual, but that doesn't mean that the meaning is unclear.
 
W

Willem

Nobody wrote:
) On Thu, 16 Jun 2011 18:39:56 +0100, J. J. Farrell wrote:
)
)> It is not a normal usage outside "Indian" English, to the extent that
)> most speakers of other forms of English find it puzzling when they first
)> come across it.
)
) Have you conducted a survey?
)
) I would be surprised if many people actually didn't understand it. People
) might find it unusual, but that doesn't mean that the meaning is unclear.

Of course the meaning is clear. It's the connotation that is unclear.

'Doubt' is like 'Question', but with the *extra* connotation that the asker
suspects the distruth of what he is asking.

I would be surprised if most people do not read this connotation
into such questions, even after repeated occurrences. I sure do.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
 

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

Forum statistics

Threads
474,091
Messages
2,570,604
Members
47,224
Latest member
Gwen068088

Latest Threads

Top