- Problem with pointer semantics

From: CFB Software <"CFB>
Date: Wed, 21 Jun 2006 10:04:41 +0930

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

> -----Original Message-----
> From: blackbox{([at]})nowhere.xy
> Behalf Of Marco Ciot
> Sent: Tuesday, 20 June 2006 8:35 PM
> To: BlackBox Mailing List
> Subject: [BlackBox] - Problem with pointer semantics
>
>
> I don't see much use in assigning an entire array to another
> as easily as "a := b".

Maybe your programming background is primarily with C-heritage languages? It
is ingrained knowledge for experienced Pascal-heritage programmers (i.e.
Pascal, Modula-2, Oberon and Component Pascal programmers) that entire
arrays, records and other arbitrary compound data structures can be assigned
with a simple assignment statement like "a := b". The compiler has all the
information

It is easy to spot a C programmer using Delphi or other extended Pascal
dialects - they use unsafe functions like MemCopy when trying to do this
sort of thing!

> In Oberon you had to use "COPY(b, a)".

No you didn't, "a := b" is used to copy arrays in Oberon. If fact you
*couldn't* use COPY for most array assignments. Oberon's COPY can only be
used with strings and character arrays. Additionally it is only a partial
copy - only copying up to, and including, the the first null character.

The equivalent to "COPY(b, a)" in Component Pascal is a := b$;

--
Chris Burrows
CFB Software
http://www.cfbsoftware.com/gpcp
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy----boundary-LibPST-iamunique-1783671750_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxX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0IEhFTFAgb3IgVU5TVUJTQ1JJ
QkUgdG8gYmxhY2tib3hAb2Jlcm9uLmNofX0AAAQAAAAAAAAAEQ==
----boundary-LibPST-iamunique-1783671750_-_---
Received on Wed Jun 21 2006 - 02:34:41 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:50 UTC