[BLACKBOX] Conversion & Casting

From: [at]} <Robert>
Date: Mon, 25 Oct 2010 22:10:52 +0100

----boundary-LibPST-iamunique-1267362632_-_-
Content-type: text/plain

On 21/10/2010 23:32, Chris Burrows wrote:

> If what you actually need is type *conversion* (for types of different size)
> rather than type *casting* then you should use the built-in procedures LONG
> and SHORT to convert from one type to another.


Folks, I am rather confused by recent posts because I don't really understand
the jargon.


Does (*conversion*) mean using different bit patterns too represent the same 'idea'?
For example the idea "-3" might be represented as C008 0000 0000 0000 as a REAL,
as FFFF FFFF FFFF FFFD as a LONGINT, as FFFF FFFD as an INTEGER, and so on. Such
transformations would use SHORT, LONG, ENTIER and implicit conversions.


Does (*casting*) mean using the same bit pattern to represent different ideas?
For example FFFF FFFD would represent -3 as an INTEGER and {0, 2..31} as a SET.
Such transformations would ideally use functions such as BITS & ORD, but would
need SYSTEM.VAL when the CP language did not give explicit support (eg from
POINTER to INTEGER)?


What (*should*) SYSTEM.VAL do when the input and output have differing numbers
of bits (which seems to be the case in recent discussions)?


What (*does*) SYSTEM.VAL do when the input and output have differing numbers of
bits?


Cheers

Robert


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1267362632_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwI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oct 25 2010 - 23:10:52 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:29 UTC