Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

programming language where values and objects are different [closed]

I am trying to get started with the 'Elements of Programming' by Alex Stepanov and Paul McJones. On Page5 last para: They say,

"This book uses a programming language that has no way to describe values and value types as separate from object and object types."

I mean, can someone give an example of a programming language where it is possible to describe values as a separate entity from an object.

like image 288
A. K. Avatar asked Dec 04 '12 05:12

A. K.


1 Answers

Sounds like they are referring to value types and reference types. Similar tp the text in this Wikipedia entry (http://en.wikipedia.org/wiki/Object_type_(object-oriented_programming))

Some object-oriented programming languages make a distinction between reference and value types, often referred to as objects and non-objects on platforms where complex value types don't exist, for reasons such as runtime efficiency and syntax or semantic issues. For example, Java has primitive wrapper classes corresponding to each primitive type: Integer and int, Character and char, Float and float, etc. Languages like C++ have little or no notion of reference type; thus, the use of object type is of little interest.

C# has both reference and value types: http://msdn.microsoft.com/en-us/library/4d43ts61(v=vs.90).aspx

like image 66
DCreeron Avatar answered Dec 03 '22 09:12

DCreeron