comp.lang.ada
 help / color / mirror / Atom feed
From: kilgallen@eisner.decus.org (Larry Kilgallen)
Subject: Better MacOS Handles through Ada (was: Implementing Pointers to Pointe
Date: 1996/09/13
Date: 1996-09-13T00:00:00+00:00	[thread overview]
Message-ID: <1996Sep13.080055.1@eisner> (raw)
In-Reply-To: 1996Sep12.144206@nova.wright.edu


In article <1996Sep12.144206@nova.wright.edu>, jmatthews@nova.wright.edu (Dr. John B. Matthews) writes:

> MacOS on PPC uses the same interface for memory management as 68K,
> although the implementation has changed considerably:-) I recently
> had the pleasure of working on MacOS bindings for GNAT on MacOS
> with MachTen. The bindings rely extensively on declarations such as
> 
>    type ObjectRec is 
>       record
>          ...
>       end record;
>    type ObjectPtr is access ObjectRec;
>    type ObjectHdl is access ObjectPtr;
> 
> The ObjectHdl.all.all syntax looks strange at first, but MacOS
> programmers at a recent trade show seemed to have no trouble
> following the sample code we showed them.

Although I was at what was probably the trade show to which you
allude, I did not discuss that aspect of Ada bindings with you.
I would maintain, however, that that construct is quite obvious
to anyone who has had to struggle with MacOS programming in any
other language.

I think this is an opportunity to prove the superiority of Ada,
by hiding those details so that future generations of MacOS
programmers do not have to deal with ugly constructs like
ObjectHdl.all.all the way their brethren do in less powerful
languages.

I believe those intricacies should be hidden in the private
part of type declarations for the various entities which might
be in heap.  Some "special" (in the church-lady sense) child
declarations might be available for direct access, but most
occasions for locking handles should be avoided and the rest
should be mediated by the handle package.  I believe what I
am looking for is a generic package, so that specific instances
can be declared for the various types one might put in heap.

I do not mean to suggest that what has been done to date is
improper -- certainly allowing MacOS programmers to emulate
their activities in previous languages is a good start, but
Ada has the capability to provide something better, hiding
some really arcane OS behaviour from programmers who have
more interest in correctness and productivity than winning
a MacOS trivia contest.

Larry Kilgallen




  reply	other threads:[~1996-09-13  0:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-09  0:00 Implementing pointers to pointers in Ada Vasilios Tourloupis
1996-09-09  0:00 ` Jonas Nygren
1996-09-09  0:00 ` John Herro
1996-09-10  0:00   ` David Shochat
1996-09-11  0:00     ` Larry Kilgallen
1996-09-12  0:00     ` Dr. John B. Matthews
1996-09-13  0:00       ` Larry Kilgallen [this message]
1996-09-14  0:00         ` Better MacOS Handles through Ada (was: Implementing Pointers to Pointe Dr. John B. Matthews
1996-09-15  0:00           ` GUI Generators and Class Libraries (was: Better MacOS Handles Larry Kilgallen
1996-09-15  0:00             ` jim hopper
1996-09-16  0:00               ` Larry Kilgallen
1996-09-17  0:00                 ` GUI Generators and Class Libraries Dr. John B. Matthews
1996-09-17  0:00                 ` GUI Generators and Class Libraries (wa David Kristola
1996-09-09  0:00 ` Implementing pointers to pointers in Ada Norman H. Cohen
1996-09-09  0:00 ` Samuel Tardieu
1996-09-09  0:00 ` Mark A Biggar
1996-09-10  0:00 ` John Demby
1996-09-10  0:00   ` Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox