473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Do objects have type?

I am seeing lots of posts (and websites like Chris Torek's) that claim
that objects have type. They are wrong.

Objects have no type, so everyone please stop spreading misinformation.
Only values have types (both lvalues and rvalues), not objects.

Thanks

Nov 14 '05 #1
2 1060
"Beta What" <li**********@gmail.com> writes:
Objects have no type, so everyone please stop spreading misinformation.


From the standard:
1 object
region of data storage in the execution environment, the
contents of which can represent values
2 NOTE When referenced, an object may be interpreted as
having a particular type; see 6.3.2.1.
Most of the time, when we're talking about an object, we're
interested in its value as a particular type. I don't think it's
too misleading to refer to this as the type of the object.

--
"You call this a *C* question? What the hell are you smoking?" --Kaz
Nov 14 '05 #2
On Sun, 20 Feb 2005 14:14:33 -0800, Beta What wrote:
I am seeing lots of posts (and websites like Chris Torek's) that claim
that objects have type. They are wrong.
If you provided an evidence to back up your rather curious claim we might
take you seriously.
Objects have no type, so everyone please stop spreading misinformation.
Only values have types (both lvalues and rvalues), not objects.
In C90 you might argue that, but how does it help? What problems will
ascribing a type to an object cause? In C99 6.5p6 objects are given the
property called an "effective type". This is a type and is a persistent
property i.e. relates to more than just lvalues in isolation. "Effective
type" in C99 makes explicit something that was implicit in C90 and
corrects a problem in C90 relating to malloc'd objects.
Thanks


C doesn't define precedence and associativity rules but they are a useful
way to describe how the language works. The same is probably true for
talking about object types, unless you can demonstrate that this
misrepresents how the language behaves (i.e. would mispredict program
output).

Lawrence

Nov 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

49
by: Steven Bethard | last post by:
I promised I'd put together a PEP for a 'generic object' data type for Python 2.5 that allows one to replace __getitem__ style access with dotted-attribute style access (without declaring another...
100
by: E. Robert Tisdale | last post by:
What is an object? Where did this term come from? Does it have any relation to the objects in "object oriented programming"?
0
by: Nashat Wanly | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaskdr/html/askgui06032003.asp Don't Lock Type Objects! Why Lock(typeof(ClassName)) or SyncLock GetType(ClassName) Is Bad Rico...
14
by: luis | last post by:
Are basic types (int, long, ...) objetcs or not? I read that in C# all are objects including basic types, derived from Object class. Then in msdn documentation says that boxing converts basic...
161
by: KraftDiner | last post by:
I was under the assumption that everything in python was a refrence... so if I code this: lst = for i in lst: if i==2: i = 4 print lst I though the contents of lst would be modified.....
7
by: Jo | last post by:
Hi, How can i differentiate between static and dynamic allocated objects? For example: void SomeFunction1() { CObject *objectp = new CObject; CObject object;
27
by: SasQ | last post by:
Hello. I wonder if literal constants are objects, or they're only "naked" values not contained in any object? I have read that literal constants may not to be allocated by the compiler. If the...
28
by: walterbyrd | last post by:
Python seems to have a log of ways to do collections of arbitrary objects: lists, tuples, dictionaries. But what if I want a collection of non-arbitrary objects? A list of records, or something...
15
by: Juha Nieminen | last post by:
I'm sure this is not a new idea, but I have never heard about it before. I'm wondering if this could work: Assume that you have a common base class and a bunch of classes derived from it, and...
19
by: Daniel Pitts | last post by:
I have std::vector<Base *bases; I'd like to do something like: std::for_each(bases.begin(), bases.end(), operator delete); Is it possible without writing an adapter? Is there a better way? Is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.