By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,825 Members | 967 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,825 IT Pros & Developers. It's quick & easy.

Okay to move an "object" will-nilly?

P: n/a
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

(2) By "willy-nilly", I mean something along the lines of
"haphazardly", but without any sense of recklessness (i.e. gleefully
doing something without expecting any sort of negative effect, even
though there may in fact be a negative effect), e.g. "A child would drink
a glass of liquid left on the kitchen table willy-nilly, blissfully
ignorant as to whether it contained bleach".

================================================== ====

Okay I'll try to keep the C++ part brief (and yes, my eventual question
is about C):

In C++, there are things called objects. They behave just like
variables, but special things happen when they're created, destroyed,
copied, assigned to, etc.. (specifically, the programmer can specify code
which is to be executed).

If you want to copy an object in C++, is it ill-advised to simply do:

ArbitraryClass original_object;

ArbitraryClass *p = malloc( sizeof *p );

memcpy( p, &original_object, sizeof original_object );
The reason why it's il-advised is that when an object is created, code
can be executed via a "constructor" which may result in the acquisition
of resources such as dynamically allocated memory. If we perform a
"shallow copy" by using "memcpy", then the resulting copy is using the
same resources as the original (when in reality, we want it to get its
own). The matter is remedied by using a copy-constructor... but I won't
get into that here.

Anyway, notwithstanding any of that, I thought it would still be OK in
C++ to move an object in memory, i.e. simply re-locate it. This would
involve memcpy'ing its bytes to a different location and simply not
making any further use of the original. I was told however that this also
is il-advised in C++, because the object's address may be of some
significance to its internal workings (i.e. the special code that gets
executed when you assign to it, destroy it, etc.). A prime example would
be an object which contains a buffer, and which also contains a pointer
to the current position in the buffer, something like:

struct StringStream {

char buffer[1024];

char *p_pos; /* Points to an element of buffer */

};

If we were to move an object of the type "StringStream", then "p_pos"
would effectively become corrupt.

So what's the significance of this?

Recently, I wrote a funky kind of algorithm for sorting an array (whether
it be an array of char's, int's, double's or perhaps a C++ class type),
and the algorithm moved objects around willy-nilly by using memcpy and
discarding the original. However, my algorithm was "broken" in the sense
that it would corrupt objects whose address was of some significance to
their internal workings.

Hence, there is an accepted etiquette in C++ that, when writing re-usable
code such as a sorting algorithm, you DON'T just re-locate objects willy-
nilly, but rather you've to resort to more elustrious means.

My question is:
Does any such etiquette exist in C? If I were writing a domestic
sorting algorithm in C, would it be acceptable for me to re-locate the
objects willy-nilly?
--

Frederick Gotham
Jun 28 '06 #1
Share this Question
Share on Google+
33 Replies


P: n/a
Frederick Gotham wrote:
<snip>
My question is:
Does any such etiquette exist in C? If I were writing a domestic
sorting algorithm in C, would it be acceptable for me to re-locate the
objects willy-nilly?


Provided nothing was relying on the previously established order of the
the array, yeah sure why not?

Though I should add that even in C++ if you had an array of class
instances you could sort them if you had overloaded the comparison and
assignment operators.

Tom

Jun 28 '06 #2

P: n/a
Frederick Gotham wrote:
In C++, there are things called objects.
In C
int int_object;
is a declaration of an object named int_object.
I believe that's also true in C++.
I was told however that this also
is il-advised in C++, because the object's address may be of some
significance to its internal workings (i.e. the special code that gets
executed when you assign to it, destroy it, etc.).
FILE type objects are like that in C.
My question is:
Does any such etiquette exist in C? If I were writing a domestic
sorting algorithm in C, would it be acceptable for me to re-locate the
objects willy-nilly?


When there's a problem with copying or overwriting objects,
such as with FILE type objects,
and the objects refered to by string literals,
you would be better off sorting an array of pointers to the objects.

--
pete
Jun 28 '06 #3

P: n/a
Frederick Gotham wrote:
...
struct StringStream {
char buffer[1024];
char *p_pos; /* Points to an element of buffer */
};

If we were to move an object of the type "StringStream", then "p_pos"
would effectively become corrupt.
...
My question is:
Does any such etiquette exist in C? If I were writing a domestic
sorting algorithm in C, would it be acceptable for me to re-locate the
objects willy-nilly?


Depends on the objects and their usage. In general, the answer is no.

Not only the objects may contain pointers that would be invalidated by
the relocation, (as in your own StringStream example,) their addresses
could also be stored in pointers somewhere else in the code and those
would be invalidated.

One more issue: How would you handle the relocation of objects
residing in dynamically allocated memory, either explicitly by calling
malloc() or because the objects were declared as automatic variables?
(The same for mixture of static and dynamic objects.)
Jun 28 '06 #4

P: n/a
Roberto Waltman (in r3********************************@4ax.com) said:

| Frederick Gotham wrote:
|| ...
|| struct StringStream {
|| char buffer[1024];
|| char *p_pos; /* Points to an element of buffer */
|| };
||
|| If we were to move an object of the type "StringStream", then
|| "p_pos" would effectively become corrupt.
|| ...
|| My question is:
|| Does any such etiquette exist in C? If I were writing a domestic
|| sorting algorithm in C, would it be acceptable for me to re-locate
|| the objects willy-nilly?
|
| Depends on the objects and their usage. In general, the answer is
| no.
|
| Not only the objects may contain pointers that would be invalidated
| by the relocation, (as in your own StringStream example,) their
| addresses could also be stored in pointers somewhere else in the
| code and those would be invalidated.
|
| One more issue: How would you handle the relocation of objects
| residing in dynamically allocated memory, either explicitly by
| calling malloc() or because the objects were declared as automatic
| variables? (The same for mixture of static and dynamic objects.)

OTOH, if you changed p_pos to be the size_t displacement into the
buffer of the (first) char of interest, then you may very well be able
to relocate StringStream(s) at will.

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto
Jun 28 '06 #5

P: n/a
On Wed, 28 Jun 2006 09:59:06 GMT, Frederick Gotham
<fg*******@SPAM.com> wrote in comp.lang.c:
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

(2) By "willy-nilly", I mean something along the lines of
"haphazardly", but without any sense of recklessness (i.e. gleefully
doing something without expecting any sort of negative effect, even
though there may in fact be a negative effect), e.g. "A child would drink
a glass of liquid left on the kitchen table willy-nilly, blissfully
ignorant as to whether it contained bleach".

================================================== ====

Okay I'll try to keep the C++ part brief (and yes, my eventual question
is about C):

In C++, there are things called objects. They behave just like
variables, but special things happen when they're created, destroyed,
copied, assigned to, etc.. (specifically, the programmer can specify code
which is to be executed).

If you want to copy an object in C++, is it ill-advised to simply do:

ArbitraryClass original_object;

ArbitraryClass *p = malloc( sizeof *p );

memcpy( p, &original_object, sizeof original_object );
The reason why it's il-advised is that when an object is created, code
can be executed via a "constructor" which may result in the acquisition
of resources such as dynamically allocated memory. If we perform a
"shallow copy" by using "memcpy", then the resulting copy is using the
same resources as the original (when in reality, we want it to get its
own). The matter is remedied by using a copy-constructor... but I won't
get into that here.

Anyway, notwithstanding any of that, I thought it would still be OK in
C++ to move an object in memory, i.e. simply re-locate it. This would
involve memcpy'ing its bytes to a different location and simply not
making any further use of the original. I was told however that this also
is il-advised in C++, because the object's address may be of some
significance to its internal workings (i.e. the special code that gets
executed when you assign to it, destroy it, etc.). A prime example would
be an object which contains a buffer, and which also contains a pointer
to the current position in the buffer, something like:

struct StringStream {

char buffer[1024];

char *p_pos; /* Points to an element of buffer */

};

If we were to move an object of the type "StringStream", then "p_pos"
would effectively become corrupt.

So what's the significance of this?

Recently, I wrote a funky kind of algorithm for sorting an array (whether
it be an array of char's, int's, double's or perhaps a C++ class type),
and the algorithm moved objects around willy-nilly by using memcpy and
discarding the original. However, my algorithm was "broken" in the sense
that it would corrupt objects whose address was of some significance to
their internal workings.

Hence, there is an accepted etiquette in C++ that, when writing re-usable
code such as a sorting algorithm, you DON'T just re-locate objects willy-
nilly, but rather you've to resort to more elustrious means.

My question is:
Does any such etiquette exist in C? If I were writing a domestic
sorting algorithm in C, would it be acceptable for me to re-locate the
objects willy-nilly?


The C qsort() function does exactly this. If you are sorting an array
of objects, the objects in the array must be move safe. If they are
not move safe, then you will have problems using them after you have
sorted them with qsort(), unless you have the degenerate case where
the array was already sorted so no swaps were performed by the sort.

In the case of your example StringStream structure, it would not be
safe to sort them by qsort(), nor would it be safe to sort them by any
other means that involved swapping.

As others have mentioned, you can define an array of pointers to the
structures, then sort this index array with another level of
indirection.

So C, just like C++, allows you to do some things that might not be
safe. You can use memcpy() or memmove() on C objects, just as you can
on POD objects in C++. It is up to the programmer to determine if the
internal structure of those objects makes the operation useful.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jun 28 '06 #6

P: n/a
Frederick Gotham said:
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".
Canonical.
(2) By "willy-nilly",
That is a contraction of "will-he-nill-he" meaning "whether he wishes it or
whether he doesn't", i.e. "like it or not".
I mean something along the lines of
"haphazardly", but without any sense of recklessness
You appear to mean "arbitrarily".

<snip>
And now a brief observation on the actual question. :-)
My question is:
Does any such etiquette exist in C? If I were writing a [canonical]
sorting algorithm in C, would it be acceptable for me to re-locate the
objects [arbitrarily]?


You haven't any choice, since that's what sorting /does/.

But if you have "deep" data, you'd be better off sorting pointers.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jun 28 '06 #7

P: n/a
Frederick Gotham wrote:
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

(2) By "willy-nilly", I mean something along the lines of
"haphazardly", but without any sense of recklessness (i.e. gleefully
doing something without expecting any sort of negative effect, even
though there may in fact be a negative effect), e.g. "A child would drink
a glass of liquid left on the kitchen table willy-nilly, blissfully
ignorant as to whether it contained bleach".


just curious, but which dialect of english is this? I've never seen
"domestic"
used the way you use it.
--
Nick Keighley

Jun 29 '06 #8

P: n/a
Nick Keighley wrote:
Frederick Gotham wrote:
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

(2) By "willy-nilly", I mean something along the lines of
"haphazardly", but without any sense of recklessness (i.e. gleefully
doing something without expecting any sort of negative effect, even
though there may in fact be a negative effect), e.g. "A child would drink
a glass of liquid left on the kitchen table willy-nilly, blissfully
ignorant as to whether it contained bleach".


just curious, but which dialect of english is this? I've never seen
"domestic"
used the way you use it.


I think he should have said "idiolect" rather than "dialect": I too
wouldn't interpret "domestic" that way (although I can see it being
used that way).

--
Chris "not a TAME hedgehog" Dollin
"No-one here is exactly what he appears." G'kar, /Babylon 5/

Jun 29 '06 #9

P: n/a
Nick Keighley posted:
Frederick Gotham wrote:
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

(2) By "willy-nilly", I mean something along the lines of
"haphazardly", but without any sense of recklessness (i.e. gleefully
doing something without expecting any sort of negative effect, even
though there may in fact be a negative effect), e.g. "A child would
drink a glass of liquid left on the kitchen table willy-nilly,
blissfully ignorant as to whether it contained bleach".


just curious, but which dialect of english is this? I've never seen
"domestic"
used the way you use it.

English as spoken in Dublin in Ireland. It's true that some of our
grammar and phrases are influenced by the Irish language, but I think our
use of "domestic" is pure English as I can't think off-hand of an
equivalent term in Irish.

We also use the term "domesticated" to indicate that an animal has been
tamed. For instance:

-John was attacked by dogs down by the lake.
-Were they wild dogs?
-No, domesticated.
All the forms of "domestic" indicate (to us in anyway) something which is
commonplace and not extraordinary.
--

Frederick Gotham
Jun 29 '06 #10

P: n/a
On Thu, 29 Jun 2006 14:40:43 GMT, Frederick Gotham
<fg*******@SPAM.com> wrote:
Nick Keighley posted:
Frederick Gotham wrote: <snip>
(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

<snip>

Since it's already consumed far too much time and space, I suggest
that you just use "ordinary", which I think everyone agrees on.

--
Al Balmer
Sun City, AZ
Jun 29 '06 #11

P: n/a
Al Balmer posted:
On Thu, 29 Jun 2006 14:40:43 GMT, Frederick Gotham
<fg*******@SPAM.com> wrote:
Nick Keighley posted:
Frederick Gotham wrote:<snip> (1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

<snip>

Since it's already consumed far too much time and space, I suggest
that you just use "ordinary", which I think everyone agrees on.

I disagree. It seems blatantly obvious that people are engaging in this
discussion purely out of curiosity and interest -- and that doesn't
constitute wasted time or space.

Feel free to killfile the thread if you like (if there's such a facility!).

--

Frederick Gotham
Jun 29 '06 #12

P: n/a
In article <LD*******************@news.indigo.ie>,
Frederick Gotham <fg*******@SPAM.com> wrote:
We also use the term "domesticated" to indicate that an animal has been
tamed. For instance: -John was attacked by dogs down by the lake.
-Were they wild dogs?
-No, domesticated. All the forms of "domestic" indicate (to us in anyway) something which is
commonplace and not extraordinary.


"domestic" is a shortened form of the Latin "domesticus" which is
derived from "domus" meaning house. The dogs in the example above
are domesticated because they live around humans, around human
habitation. Things likely to be found around houses are more likely
to be commonplace and not extraordinary, but it is possible, for example,
to have a domesticated leopard or boa constrictor.

In the Oxford English Dictionary (oed.com), *none* of the shades of
meaning of "domestic" (including in the latest drafts) is listed as
pertaining to that which is commonplace and ordinary.

Thus, I would judge that your use of "domestic" is a -relatively-
localized extension, which would be likely to confuse most people.
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton
Jun 29 '06 #13

P: n/a
Walter Roberson posted:

All the forms of "domestic" indicate (to us in anyway) something which
is commonplace and not extraordinary.


"domestic" is a shortened form of the Latin "domesticus" which is
derived from "domus" meaning house. The dogs in the example above
are domesticated because they live around humans, around human
habitation. Things likely to be found around houses are more likely
to be commonplace and not extraordinary, but it is possible, for
example, to have a domesticated leopard or boa constrictor.

In the Oxford English Dictionary (oed.com), *none* of the shades of
meaning of "domestic" (including in the latest drafts) is listed as
pertaining to that which is commonplace and ordinary.

Thus, I would judge that your use of "domestic" is a -relatively-
localized extension, which would be likely to confuse most people.

Actually, this thread has opened my eyes to something.

I've never thought of the word "domestic" as meaning "from home" or "from
this nation or country"... and only now do I see that that's how
American's tend to use the word.

Take the term, "domestic violence"; I always used to think that it meant
"common, everyday violence", but now it seems as though it actually means
"violence in the home". Am I right?
--

Frederick Gotham
Jun 29 '06 #14

P: n/a
Frederick Gotham wrote
Actually, this thread has opened my eyes to something.

I've never thought of the word "domestic" as meaning "from home" or "from
this nation or country"... and only now do I see that that's how
American's tend to use the word.

Take the term, "domestic violence"; I always used to think that it meant
"common, everyday violence", but now it seems as though it actually means
"violence in the home". Am I right?


That's the only meaning I understood for that expression.
(Not an American, but living in the USA.)

Jun 29 '06 #15

P: n/a
Frederick Gotham said:

<snip>
I've never thought of the word "domestic" as meaning "from home" or "from
this nation or country"... and only now do I see that that's how
American's tend to use the word.
It's how the British use the word, too - especially those with a Latin
O-level lurking in their background.
Take the term, "domestic violence"; I always used to think that it meant
"common, everyday violence",
No, the term for that is "football".
but now it seems as though it actually means "violence in the home".


That's precisely what it means, yes.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jun 29 '06 #16

P: n/a
Frederick Gotham wrote:
Walter Roberson posted:

All the forms of "domestic" indicate (to us in anyway) something which
is commonplace and not extraordinary.
"domestic" is a shortened form of the Latin "domesticus" which is
derived from "domus" meaning house. The dogs in the example above
are domesticated because they live around humans, around human
habitation. Things likely to be found around houses are more likely
to be commonplace and not extraordinary, but it is possible, for
example, to have a domesticated leopard or boa constrictor.

In the Oxford English Dictionary (oed.com), *none* of the shades of
meaning of "domestic" (including in the latest drafts) is listed as
pertaining to that which is commonplace and ordinary.

Thus, I would judge that your use of "domestic" is a -relatively-
localized extension, which would be likely to confuse most people.

Actually, this thread has opened my eyes to something.

I've never thought of the word "domestic" as meaning "from home" or "from
this nation or country"... and only now do I see that that's how
American's tend to use the word.


I've never seen the word used any other way, by American or otherwise.

I took you up on your statement that the definition of domestic has a
different meaning in Ireland by searching for the word on Ireland-only
websites, after reviewing some several dozen uses of the word I am
beginning to think that you are alone in the confusion of its usage as
I didn't see one instance of it used the way you have described, either
that or it has an extremely localized connotation.
Take the term, "domestic violence"; I always used to think that it meant
"common, everyday violence", but now it seems as though it actually means
"violence in the home". Am I right?


Yes, that's what it means in Ireland too:
http://www.womensaid.ie/pages/domestic/domestic.htm

Robert Gamble

Jun 29 '06 #17

P: n/a
Frederick Gotham (in SQ*******************@news.indigo.ie) said:

| Take the term, "domestic violence"; I always used to think that it
| meant "common, everyday violence", but now it seems as though it
| actually means "violence in the home". Am I right?

Right. It's another oxymoron, since the phrase is applied only to
violence between members of a family. I've never heard of the term
used to describe violent treatment of intruders.

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto
Jun 29 '06 #18

P: n/a
On Thu, 29 Jun 2006 15:56:39 GMT, Frederick Gotham
<fg*******@SPAM.com> wrote:
Al Balmer posted:
On Thu, 29 Jun 2006 14:40:43 GMT, Frederick Gotham
<fg*******@SPAM.com> wrote:
Nick Keighley posted:

Frederick Gotham wrote:

<snip>
> (1) By "domestic", I mean "ordinary, run-of-the-mill, not
> extraordinary or strange".

<snip>

Since it's already consumed far too much time and space, I suggest
that you just use "ordinary", which I think everyone agrees on.

I disagree. It seems blatantly obvious that people are engaging in this
discussion purely out of curiosity and interest -- and that doesn't
constitute wasted time or space.

Feel free to killfile the thread if you like (if there's such a facility!).


Nah, I'm currently set to switch threads on subject change, so it just
pops up again. How about we discuss the World Cup matches, instead?

--
Al Balmer
Sun City, AZ
Jun 29 '06 #19

P: n/a
Al Balmer posted:

Nah, I'm currently set to switch threads on subject change, so it just
pops up again. How about we discuss the World Cup matches, instead?

Might have an alogorithm lying around somewhere to calculate odds.

typedef int bool;

unsigned long CalculateOdds( bool TeamIsFromSouthAmerica );
--

Frederick Gotham
Jun 29 '06 #20

P: n/a
Richard Heathfield wrote:
Frederick Gotham said:

<snip>
I've never thought of the word "domestic" as meaning "from home" or "from
this nation or country"... and only now do I see that that's how
American's tend to use the word.


It's how the British use the word, too - especially those with a Latin
O-level lurking in their background.


The same applies to English people without any ability in any foreign
language.
Take the term, "domestic violence"; I always used to think that it meant
"common, everyday violence",


No, the term for that is "football".


That is a comparatively recent and unfortunate development. I say that
as someone who does not like football.
but now it seems as though it actually means "violence in the home".


That's precisely what it means, yes.


Indeed. That is the only meaning that would ever have occurred to me.
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
Jun 29 '06 #21

P: n/a
Richard Heathfield schrieb:
Frederick Gotham said:
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".
Canonical.
(2) By "willy-nilly",


Never heard of.
That is a contraction of "will-he-nill-he" meaning "whether he wishes it or
whether he doesn't", i.e. "like it or not".
I mean something along the lines of
"haphazardly", but without any sense of recklessness


You appear to mean "arbitrarily".


My dictionary translates it to 'unordentlich' (german), which can be
retranslated to slovenly, untidily, sloppy.

Th.
Jun 29 '06 #22

P: n/a
Frederick Gotham wrote:
English as spoken in Dublin in Ireland. It's true that some of our
grammar and phrases are influenced by the Irish language, but I think our
use of "domestic" is pure English as I can't think off-hand of an
equivalent term in Irish.
It really isn't, though. ;)
We also use the term "domesticated" to indicate that an animal has been
tamed. For instance:


Exactly, "brought into the home." You can look it up in the OED if
you want the Proper English definition. "Domestic" means "of the
domicile," which is your home, roughly speaking.

-tom!
Jun 30 '06 #23

P: n/a
Morris Dovey wrote:
Frederick Gotham (in SQ*******************@news.indigo.ie) said:

| Take the term, "domestic violence"; I always used to think that it
| meant "common, everyday violence", but now it seems as though it
| actually means "violence in the home". Am I right?

Right. It's another oxymoron,


I thought an "oxymoron" was a phrase where the terms were contradictory,
like "colourless green" or "beautifully ugly" [1]; I don't see anything
contradictory between "domestic" and "violence". (Alas.)

[1] Not to be confused with "military intelligence", which isn't an
oxymoron, but where /describing/ as such implies a contradiction
suited to the speaker's purposes. So I am led to believe.

--
Chris "you can lead a horse to water, but you can't make it." Dollin
"Life is full of mysteries. Consider this one of them." Sinclair, /Babylon 5/

Jun 30 '06 #24

P: n/a
Frederick Gotham <fg*******@SPAM.com> wrote:
Nick Keighley posted:
Frederick Gotham wrote:
(My dialect of English seems to puzzle people at times, so I'll first
clarify a few terms which I use in the following post:)

(1) By "domestic", I mean "ordinary, run-of-the-mill, not
extraordinary or strange".

(2) By "willy-nilly", I mean something along the lines of
"haphazardly", but without any sense of recklessness (i.e. gleefully
doing something without expecting any sort of negative effect, even
though there may in fact be a negative effect), e.g. "A child would
drink a glass of liquid left on the kitchen table willy-nilly,
blissfully ignorant as to whether it contained bleach".


just curious, but which dialect of english is this? I've never seen
"domestic" used the way you use it.


English as spoken in Dublin in Ireland. It's true that some of our
grammar and phrases are influenced by the Irish language, but I think our
use of "domestic" is pure English as I can't think off-hand of an
equivalent term in Irish.


It may be pure Ireland-mutated English, but as normal English I'm afraid
both of those are beyond the pale.

Richard
Jun 30 '06 #25

P: n/a
Chris Dollin (in e8**********@malatesta.hpl.hp.com) said:

| Morris Dovey wrote:
|
|| Frederick Gotham (in SQ*******************@news.indigo.ie) said:
||
||| Take the term, "domestic violence"; I always used to think that it
||| meant "common, everyday violence", but now it seems as though it
||| actually means "violence in the home". Am I right?
||
|| Right. It's another oxymoron,
|
| I thought an "oxymoron" was a phrase where the terms were
| contradictory, like "colourless green" or "beautifully ugly" [1]; I
| don't see anything contradictory between "domestic" and "violence".
| (Alas.)

I guess it might matter if "domestic" meant "of the house" or "of the
home". If the latter, I perceive a strong contradiction - but I'm not
sure that distinction is made universally.

| [1] Not to be confused with "military intelligence", which isn't an
| oxymoron, but where /describing/ as such implies a contradiction
| suited to the speaker's purposes. So I am led to believe.

It's a play on the word "intelligence", of course. I spent a few years
in MI and those on the inside would generally agree that it _is_ an
oxymoron. :-)

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto
Jun 30 '06 #26

P: n/a
On Fri, 30 Jun 2006 08:24:28 -0500, "Morris Dovey" <mr*****@iedu.com>
wrote:
Chris Dollin (in e8**********@malatesta.hpl.hp.com) said:

| Morris Dovey wrote:
|
|| Frederick Gotham (in SQ*******************@news.indigo.ie) said:
||
||| Take the term, "domestic violence"; I always used to think that it
||| meant "common, everyday violence", but now it seems as though it
||| actually means "violence in the home". Am I right?
||
|| Right. It's another oxymoron,
|
| I thought an "oxymoron" was a phrase where the terms were
| contradictory, like "colourless green" or "beautifully ugly" [1]; I
| don't see anything contradictory between "domestic" and "violence".
| (Alas.)

I guess it might matter if "domestic" meant "of the house" or "of the
home". If the latter, I perceive a strong contradiction - but I'm not
sure that distinction is made universally.
That is my (and most dictionaries) definition. E.g. "Of or relating to
the family or household." The concept is scaled up to include larger
"families", thus we have domestic wine and domestic foodcrops, as
opposed to imported.
| [1] Not to be confused with "military intelligence", which isn't an
| oxymoron, but where /describing/ as such implies a contradiction
| suited to the speaker's purposes. So I am led to believe.

It's a play on the word "intelligence", of course. I spent a few years
in MI and those on the inside would generally agree that it _is_ an
oxymoron. :-)


--
Al Balmer
Sun City, AZ
Jun 30 '06 #27

P: n/a
On Fri, 30 Jun 2006 09:03:06 GMT, in comp.lang.c ,
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote:
It may be pure Ireland-mutated English, but as normal English I'm afraid
both of those are beyond the pale.


Quite literally, as it happens. I assume you know where the expression
"beyond the pale" comes from? :-)
--
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
Jun 30 '06 #28

P: n/a
In article <OE*************@news.uswest.net>,
Morris Dovey <mr*****@iedu.comwrote:
....
>It's a play on the word "intelligence", of course. I spent a few years
in MI and those on the inside would generally agree that it _is_ an
oxymoron. :-)
The word has (at least) two distinct meanings:
1) The ability (to think/reason/etc - generally, acquire
knowledge/information). This is the most common sense.
2) knowledge/information itself (as a commodity). This is the
sense in which the term MI is used.

Jul 10 '06 #29

P: n/a
In article <7c********************************@4ax.com>,
Al Balmer <al****************@att.netwrote:
....
>That is my (and most dictionaries) definition. E.g. "Of or relating to
the family or household." The concept is scaled up to include larger
"families", thus we have domestic wine and domestic foodcrops, as
opposed to imported.
Agreed. First, in the context of the OP (in both senses of that term),
it was certainly an odd choice of word (particularly in the
anal-retentive environment known as clc), but we all got a laugh out of it.
And that's the important thing!

Second, m-w gives this def'n:

4 : devoted to home duties and pleasures <leading a quietly domestic life>

which I could imagine as being "almost there". I would *not* be surprised
to learn that this is, in fact, acceptable usage in Dublin Irish English.

Jul 10 '06 #30

P: n/a
Frederick Gotham wrote:
struct StringStream {
char buffer[1024];
char *p_pos; /* Points to an element of buffer */
};

If I were writing a domestic sorting algorithm in C, would it be
acceptable for me to re-locate the objects willy-nilly?
No:
1) It could corrupt the object (eg. if it were a struct
StringStream).
2) There may be pointers to the current objects.
3) You don't know how the objects should be allocated.

Jul 11 '06 #31

P: n/a
Frederick Gotham wrote:
Walter Roberson posted:
>>
"domestic" is a shortened form of the Latin "domesticus" which is
derived from "domus" meaning house.

I've never thought of the word "domestic" as meaning "from home" or "from
this nation or country"... and only now do I see that that's how
American's tend to use the word.

Take the term, "domestic violence"; I always used to think that it meant
"common, everyday violence", but now it seems as though it actually means
"violence in the home". Am I right?
Another common usage is "domestic terminal" vs. "international
terminal" at the airport.

Jul 11 '06 #32

P: n/a
Old Wolf posted:

3) You don't know how the objects should be allocated.

"malloc" returns a pointer to a byte in memory which is a suitable starting
location for an object of any type.

But yes, if I were to use a simple local automatic storage char array, I'd be
in trouble.

--

Frederick Gotham
Jul 11 '06 #33

P: n/a
Frederick Gotham wrote:
Old Wolf posted:
3) You don't know how the objects should be allocated.

"malloc" returns a pointer to a byte in memory which is a suitable starting
location for an object of any type.

But yes, if I were to use a simple local automatic storage char array, I'd be
in trouble.
They could also be allocated with a custom allocator, and/or
the system might not support malloc.

Jul 11 '06 #34

This discussion thread is closed

Replies have been disabled for this discussion.