stateless or not

F

Franz Bayer

For the philosophs:

Does an object, which does not exist, have any state, e.g. the state of not
existing?

/Franz
 
M

Michael N. Christoff

Franz Bayer said:
For the philosophs:

Does an object, which does not exist, have any state, e.g. the state of not
existing?

One would have to have fix on a particular mathematical definition of
'object' and 'state' first. As far as I know, there is no one definition
for either concepts.

btw - this would be better posted in comp.object.



l8r, Mike N. Christoff
 
E

Eric Sosman

Franz said:
For the philosophs:

Does an object, which does not exist, have any state, e.g. the state of not
existing?

An object that does not exist has no state.

However, there is an uncountably infinite number of
non-existent objects, so when you try to calculate how
much memory is needed to record all that state you wind
up with an expression of the form `infinity times zero',
which is indeterminate. The product could be zero, or
could be some other finite number, or could itself be
infinite.

To guard against the last possibility, be sure to
start your JVM with plenty of heap space. Either that,
or never don't not create any non-existent objects.
 
M

Michael N. Christoff

Eric Sosman said:
An object that does not exist has no state.

However, there is an uncountably infinite number of
non-existent objects,

I would say it all depends on the definitions of things. Especially the
meaning of "non-existent object". Its like saying X = 'the set of integers
that do not exist'. More formally:

X = { n | n is an integer AND n does not exist }

This is a contradiction, since if n is an integer then it certainly exists
by the definition of the term 'integer'.



l8r, Mike N. Christoff
 
J

Jim Cochrane

One would have to have fix on a particular mathematical definition of
'object' and 'state' first. As far as I know, there is no one definition
for either concepts.

btw - this would be better posted in comp.object.

The question cannot be answered without a precise specification of the OP's
requirements for the application to which the question applies. (Of
course, if there is no application, the question cannot be answered.)
 
M

Michael N. Christoff

Jim Cochrane said:
The question cannot be answered without a precise specification of the OP's
requirements for the application to which the question applies. (Of
course, if there is no application, the question cannot be answered.)

Why not? Can't one define the terms 'state' and 'object' without reference
to a particular application? ie: I can define the term 'empty String' as
any Java String object x where x.equals("") returns true, without saying I'm
writing an XML parser for example.



l8r, Mike N. Christoff
 
J

Jim Cochrane

Why not? Can't one define the terms 'state' and 'object' without reference
to a particular application? ie: I can define the term 'empty String' as
any Java String object x where x.equals("") returns true, without saying I'm
writing an XML parser for example.

And if you define these terms, how do you know the definitions will be
acceptable in terms of what the OP wants to do? I think that without
a context for the questions - requirements -, you're forced to make
assumptions - leading to endless philosphical and/or mathematical
speculations.

However, if the OP simply wants to know the answer to his questions outside
of a particular context, the answer is that there is no answer without a
context.

On the other hand, perhaps the OP is just trying to start an endless
philisophical discussion, and we're indulging him. :-]

(Of course, this is off topic for c.l.j.p.)
 
M

Michael N. Christoff

Jim Cochrane said:
And if you define these terms, how do you know the definitions will be
acceptable in terms of what the OP wants to do? I think that without
a context for the questions - requirements -, you're forced to make
assumptions - leading to endless philosphical and/or mathematical
speculations.

However, if the OP simply wants to know the answer to his questions outside
of a particular context, the answer is that there is no answer without a
context.

What if he just wants an answer to the specific question he asked? :) To
answer the OP's original question, nothing but definitions of his terms are
required. ie: If he asked (for example) 'does String x = ""; do the same
thing as String x = null; ?' or 'what does the goto keyword do in Java?',
then no mention of a particular app or context (besides the fact the code is
in Java) is needed to answer these specific questions. On the other hand if
he asked, "What is the best way to design a GUI?", then the particular
application would be needed to answer properly.
On the other hand, perhaps the OP is just trying to start an endless
philisophical discussion, and we're indulging him. :-]

(Of course, this is off topic for c.l.j.p.)

We can both agree on this. :)



l8r, Mike N. Christoff
 
C

Carl Howells

Michael said:
thing as String x = null; ?' or 'what does the goto keyword do in Java?',

I know the answer to that one... The goto keyword causes a compile error!
 
M

Michael N. Christoff

Carl Howells said:
Java?',

I know the answer to that one... The goto keyword causes a compile error!

Yes, but it is still a keyword in Java. Sun's online book "The Java
Language Specification" 2nd ed. defines both const and goto as keywords that
are not currently used, however I have seen other websites define them as
reserved words, but not keywords.



l8r, Mike N. Christoff
 
T

Tor Iver Wilhelmsen

Franz Bayer said:
Does an object, which does not exist, have any state, e.g. the state of not
existing?

The more interesting question is: Does the "null" object have
behaviour? In Smalltalk and Python it does, in Java it does not. In
Java, the VM instead treats null values in special ways (instructions
like "ifnonnull" and "aconst_null").
 
T

Thomas G. Marshall

Tor Iver Wilhelmsen said:
The more interesting question is: Does the "null" object have
behaviour? In Smalltalk and Python it does, in Java it does not. In
Java, the VM instead treats null values in special ways (instructions
like "ifnonnull" and "aconst_null").

I suspect then that the "null" object is /not/ "no object".
 
J

Jim Cochrane

Jim Cochrane said:
[snip]
The question cannot be answered without a precise specification of the
OP's
requirements for the application to which the question applies. (Of
course, if there is no application, the question cannot be answered.)

Why not? Can't one define the terms 'state' and 'object' without reference
to a particular application? ie: I can define the term 'empty String' as
any Java String object x where x.equals("") returns true, without saying I'm
writing an XML parser for example.

And if you define these terms, how do you know the definitions will be
acceptable in terms of what the OP wants to do? I think that without
a context for the questions - requirements -, you're forced to make
assumptions - leading to endless philosphical and/or mathematical
speculations.

However, if the OP simply wants to know the answer to his questions outside
of a particular context, the answer is that there is no answer without a
context.

What if he just wants an answer to the specific question he asked? :) To
answer the OP's original question, nothing but definitions of his terms are
required. ie: If he asked (for example) 'does String x = ""; do the same
thing as String x = null; ?' or 'what does the goto keyword do in Java?',
then no mention of a particular app or context (besides the fact the code is
in Java) is needed to answer these specific questions. On the other hand if
he asked, "What is the best way to design a GUI?", then the particular
application would be needed to answer properly.

Here's the original question:

"Does an object, which does not exist, have any state, e.g. the state
of not existing?"

My point is that there is no definite answer to his question, since he does
not supply any context or definitions, which are needed to provide an
answer. It could be answered conditionally - for example:

If we define existence of an object as having a state marked as
"existing", and non-existence of an object as having a state marked as
"not existing", then the answer is, yes, with these rules an object
has state.

But this is not very helpful, since he could easily figure this out for
himself. One could come up with other reasonable definitions for which the
answer is no; but then which one would be valid for what the OP has in
mind? He would have to decide for himself which set of definitions are
valid for what he has in mind - essentially, he has to answer the question
by himself.

If, on the other hand, he really meant: Is it reasonable to develop a
system for which an object that does not exist has state (the state of
not existing)?

Then I think the answer would be something like: Such a model sounds
reasonable and if it facilitated the development of a system in a timely
manner that meets its requirements, the answer is probably yes.

Anyway, it's probably time to stop bugging people with this OT subthread.
You can email me if you really need to respond. (See note below.)
 
T

Thomas G. Marshall

tom bender said:
Is it that the 'null' object is an existing object with particular
behaviour and *not* a non exiting object.

Maybe an object that doesn't exist can't be referenced therefore we
cannot know what it's state is? Does god have brown hair?

Is an unreferencable object a property of the object? Maybe. Then that
might qualify it has having a state then?

I know. We might as well ask a question I asked my teacher in 2nd grade:
"what color is nothing?"
 
T

tom bender

Thomas said:
I suspect then that the "null" object is /not/ "no object".
Is it that the 'null' object is an existing object with particular
behaviour and *not* a non exiting object.

Maybe an object that doesn't exist can't be referenced therefore we
cannot know what it's state is? Does god have brown hair?

Is an unreferencable object a property of the object? Maybe. Then that
might qualify it has having a state then?

TomB
 
J

Joona I Palaste

I would say it all depends on the definitions of things. Especially the
meaning of "non-existent object". Its like saying X = 'the set of integers
that do not exist'. More formally:
X = { n | n is an integer AND n does not exist }
This is a contradiction, since if n is an integer then it certainly exists
by the definition of the term 'integer'.

I see no contradiction in the above. X is simply the empty set.
 
T

Timo Kinnunen

For the philosophs:

Does an object, which does not exist, have any state, e.g. the state of not
existing?

I don't know about the state of not existing, but it can have some state.
For example:

public class Properties {
private static int count = 0;
private static Hashtable map = new Hashtable();
private final int which;

public Properties() { this.which = count++; }
public void set(String name, Object value) {
map.put(which + name, value); }
public Object get(String name) {
return map.get(which + name); }
}

When an instance of this class is reclaimed, it leaves its state behind.
 
T

Thomas G. Marshall

Timo Kinnunen said:
I don't know about the state of not existing, but it can have some
state. For example:

public class Properties {
private static int count = 0;
private static Hashtable map = new Hashtable();
private final int which;

public Properties() { this.which = count++; }
public void set(String name, Object value) {
map.put(which + name, value); }
public Object get(String name) {
return map.get(which + name); }
}

When an instance of this class is reclaimed, it leaves its state
behind.

That only says that state can be stored elsewhere (in this case, in the
class statics themselves). It says nothing of the state of a non-existent
object.
 
T

Timo Kinnunen

That only says that state can be stored elsewhere (in this case, in the
class statics themselves). It says nothing of the state of a non-existent
object.

Well, I'd say that in this case, the state of a non-existent (or no longer
existing) object is stored elsewhere :)
 

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,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top