comp.lang.ada
 help / color / mirror / Atom feed
From: Roga Danar <smithm_nospam@XXX_nospam_stelnj.com>
To: Mats.Weber@elca-matrix.ch
Subject: Re: win32ada design question/problem
Date: 1998/11/27
Date: 1998-11-27T19:31:03+00:00	[thread overview]
Message-ID: <365F0CC4.36199B9D@XXX_nospam_stelnj.com> (raw)
In-Reply-To: 36501A46.82C348D3@elca-matrix.ch

I agree completely.  The bindings I use are done in this way.

Mats Weber wrote:

> Tom Moran wrote:
>
> > Win32Ada is just a thin binding to that, and Windows (based on C) uses
> > the equivalent of Unchecked_Access all over.  You either swallow hard
> > and do C-ish code with Ada syntax, or you hide it in a thicker
> > binding.
>
> I disagree. Windows was written in C, as was UNIX, and the same problems
> would appear in a UNIX binding if it were done the same way (using fancy
> access types).
>
> I think the problem with this binding is the inappropriate use of
> general access types, because:
>
> - they encourage using global declarations for the parameters (and this
> is actually happening: see the examples), when using 'Unchecked_Access
> would be far better.
>
> - they don't document what is actually being done, e.g. to pass a
> string, you must pass an '(Unchecked_)Access to its first character,
> which is definitely not the Ada way of doing things and could even be a
> problem with an aggressive optimizer.
>
> I think a binding done with System.Address for pointers and strings, and
> Interfaces.C.Int for integers, would be far better. It's the way thin
> bindings were done in Ada 83 and it's a method that has always worked
> fine and does not have the general access type approach's problems.

--







  parent reply	other threads:[~1998-11-27  0:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-13  0:00 win32ada design question/problem Mats Weber
1998-11-13  0:00 ` dennison
1998-11-16  0:00   ` Stephen Leake
1998-11-16  0:00     ` Tucker Taft
1998-11-17  0:00     ` dennison
1998-11-17  0:00       ` Mats Weber
1998-11-17  0:00         ` dennison
1998-11-17  0:00           ` Tucker Taft
1998-11-18  0:00             ` Tom Moran
1998-11-18  0:00               ` dennison
1998-11-17  0:00           ` Mats Weber
1998-11-13  0:00 ` Tom Moran
1998-11-16  0:00   ` Mats Weber
1998-11-18  0:00     ` Tom Moran
1998-11-18  0:00       ` dennison
1998-11-19  0:00       ` Mats Weber
1998-11-19  0:00       ` Mats Weber
1998-11-19  0:00         ` David Botton
1998-11-19  0:00           ` Mats Weber
1998-11-23  0:00             ` Marin David Condic
1998-11-19  0:00         ` dennison
1998-11-19  0:00           ` David Botton
1998-11-27  0:00     ` Roga Danar [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-11-19  0:00 tmoran
1998-11-19  0:00 ` dennison
1998-11-19  0:00   ` Tom Moran
1998-11-20  0:00     ` dennison
1998-11-20  0:00       ` Tom Moran
1998-11-23  0:00     ` Marin David Condic
1998-11-23  0:00       ` Mats Weber
1998-11-24  0:00         ` dennison
replies disabled

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