Re: Definitions of Typecast etc.

rkrayhawk@aol.com (RKRayhawk)
15 Feb 2001 00:35:33 -0500

          From comp.compilers

Related articles
Definitions of Typecast etc. vbdis@aol.com (2001-02-04)
Re: Definitions of Typecast etc. rkrayhawk@aol.com (2001-02-15)
Re: Definitions of Typecast etc. vbdis@aol.com (2001-02-17)
Re: Definitions of Typecast etc. rkrayhawk@aol.com (2001-02-23)
Re: Definitions of Typecast etc. joachim_d@gmx.de (Joachim Durchholz) (2001-02-25)
| List of all articles for this month |
From: rkrayhawk@aol.com (RKRayhawk)
Newsgroups: comp.compilers
Date: 15 Feb 2001 00:35:33 -0500
Organization: AOL http://www.aol.com
References: 01-02-035
Keywords: practice
Posted-Date: 15 Feb 2001 00:35:33 EST

vbdis@aol.com (VBDis)
Date: 4 Feb 2001 22:17:34 -0500
posted a query about lexicon entries for


<<
... terms like
type cast, type coercion, type conversion. Delphi added another
difference, with value typecasts and variable typecasts, ...


Can someone help me with according explanations?
>>


I shall brave a response;


  type - an attribute, or set of attributes, of information within a computer:
usually relating to format of data elements, minimum and maximum expected
values (usually derived from the size or width of data item), and possibly
physical architecture features such as endianess. Technically type can describe
aspects of executable code as well as passive data.


  type compliance -
and
  type checking -
data values and program code actually stored in computers sometimes really is
formatted according to the type recorded or assumed for that data, sometimes
not. Thus many programming environments offer type checking mechanisms.


  type importance - it is usually important for the sender and recever of data
to agree upon all aspects of data type, so that information is not
misinterpreted. Thus the term 'type', potentially, covers all aspects of data
exchange that relate to the integritiy of the contents of stored data. But the
'type' lexicon usually focuses on just a few physical features of data layout.
So notions, such as compression and encryption, are not usually included in
data type explanations.


  type cast - an action taken by a programmer (human or automated), or the
markings in a code specification representing the programmer's expression,
directing a controlled interpretation of the type of a data item (or section of
active executable code). In some programming contexts the machinery may make an
assumption about type that the programmer wishes to defeat. In other contexts
the other code raises no assumption at all about data type, and the programmer
must cast the item to get the machinery to accept the code.


  type coercion - an action taken by a machine (or compilation technonology) to
transform a data item from its actual type to another type for compatibility
with actual execution of a coded command or interface to an invoked function.
Coercion is frequently transparent to the coder. Coercion can involved changes
as simplistic as truncation or rounding, and can occur inbound to functions
parameters as well as outbound from functions or calculations as generated
values are assigned into destination data items. Although generalized, the term
is perhaps best used to desribe changes in data element type to map a function
invocation to the signature of an available function (of that name). Type
coercion can be tricky when there are multiple available function signatures to
which the coded parameters could conceivably be mapped, (thus there is a
special area of precedence that relates to the rules that a language
implementation will follow to find the first or best fit between coded
invocation and specific function engaged). Coercion can be easy compared to
finding the right signature.


  type conversion - a term refering to the coercion of data type by machines
(silently or accompanied by warnings) or the set of (source) code written
explicitly to rearrange data format. The term can also describe the executable
code, inline or function, that actually transforms the data.


  type gotcha - data values are not necessarily preserved when the type is
changed. Obvious examples would be truncation or rounding when going from
floating point to integer. Less obvious is the change in value when moving
betwixt two different precisions of floating point.


value typecasts - need other contributors here


variable typecasts - need other contributors here




Robert Rayhawk
rayhawk@alum.calberkeley.org


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.