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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ca21162c929cc36f X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: Implementing pointers to pointers in Ada Date: 1996/09/11 Message-ID: <1996Sep11.091148.1@eisner>#1/1 X-Deja-AN: 179928971 x-nntp-posting-host: eisner.decus.org references: <511sp9$ogs@newsbf02.news.aol.com> <3235E2C3.636F@itg-sepg.logicon.com> x-nntp-posting-user: KILGALLEN x-trace: 842447512/9875 organization: LJK Software newsgroups: comp.lang.ada Date: 1996-09-11T00:00:00+00:00 List-Id: In article <3235E2C3.636F@itg-sepg.logicon.com>, David Shochat writes: > John Herro wrote: > >> Of course, it's not obvious WHY you want to use two levels of indirection. > > It was necessary for 68K Mac programming (I don't know about PPC). The > OS had to be able to move heap objects around whenever memory got tight, > so the programmer would access most GUI objects through a so-called > "handle" which was a pointer to a "master" pointer to the actual data. > In Meridian's Ada for the Mac, this was declared just as the examples in > this thread show (without the "all" -- it was Ada 83). This scheme was > crucial to allow the original Mac to run with only 128K. This scheme is > actually much older than the Mac. I would _hope_ that Macintosh Ada 95 implementations would make details of the handle mechanism _private_, since many mistakes one can make involve saving a copy of the middle pointer when the handle is not locked. This is _exactly_ the sort of situation where higher level languages can help, and Ada has the syntax to do it. Larry Kilgallen