From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,61006929d3e14455 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!cyclone1.gnilink.net!gnilink.net!wn14feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail From: Dave Thompson Newsgroups: comp.lang.ada Subject: Re: Ada Pointer Size Problem Message-ID: References: <35f054ea.0410101150.25bec2f5@posting.google.com> <6Joad.8869$UP1.8086@newsread1.news.pas.earthlink.net> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 21 Oct 2004 01:16:48 GMT NNTP-Posting-Host: 12.75.180.42 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1098321408 12.75.180.42 (Thu, 21 Oct 2004 01:16:48 GMT) NNTP-Posting-Date: Thu, 21 Oct 2004 01:16:48 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:5553 Date: 2004-10-21T01:16:48+00:00 List-Id: On Mon, 11 Oct 2004 05:18:58 GMT, Jeffrey Carter wrote: > skidmarks wrote: > > Any idea of what I'm really missing? > > Probably the difference between pointers in simple languages and access > values in high-level languages. In C/++, a pointer is an int is an > address. In Ada, they're 3 different things. This is overstating the case. In C a pointer value is in practice just an address. This isn't formally required, but traditionally it's so; the standard specifies (intentionally) semantics that allow it; and anything else is unacceptably (to most users) inefficient, since C requires many array accesses -- thus including character strings -- to go through pointers, and all pointers of a given type to be the same -- unlike non-all access or PL/I OFFSET. But (unlike its predecessor B) a C pointer/address is not just an int. It has addition and subtraction, but scaled by the target size (stride) -- and standardly only required to work within a single variables; there is not required to be a flat address space, although that is common and some C program/mers unportably rely on it. Other operations which would be meaningless like multiply and divide are prevented, and conversions are explicit, like System.Address. In C++ the same is true for builtin/standard pointers, but the standard library provides a number of enhanced pointer-like types that can be used transparently, and you (or someone) can write your own. - David.Thompson1 at worldnet.att.net