comp.lang.ada
 help / color / mirror / Atom feed
From: email@domain.com (Dale Stanbrough)
Subject: Re: About to give up...
Date: 1998/08/06
Date: 1998-08-06T12:16:16+00:00	[thread overview]
Message-ID: <email-0608982217250001@dale.ppp.cs.rmit.edu.au> (raw)
In-Reply-To: 6qbtl7$v6$1@nnrp1.dejanews.com

Mr i96danma@my-dejanews.com wrote:

" I've been programming in Ada 95 for a while and like the language because of
  it's strong type checking, OO-friendly style and clean and understandable
  code.
  
  Just recently I stepped into the world of Win32-programming and got hold of
  the Win32Ada binding, which I after some effort and a lot of help (thanks
  Jesper!) finally got working.
  
  The first steps were no problem and I quickly got used to the API. The worst
  problems though were the type conversions, where Ada's type checking suddenly
  was an obstacle to overcome, and the fact that you always have to take care of
  the return values, even if you don't care. And it seems as Win32 returns a lot
  of values that are, most of the time, unimportant."

I view this as being a good thing. The functions are returning a value for 
a reason (i presume!). Surely it is ignore at your peril?
If you really don't like it, or don't want an if statement at each step
you can either

   write a wrapper function to give it a procedure call syntax, which
   can either ignore the return result, or raise an exception

or

   do...

      dummy : integer range 0..0;

      dummy := some_function_call (...);

and have a constraint error exception if the function returns a dud value
(presuming 0 = ok).

 
" Altogether I see these drawbacks as (almost) impossible to overcome and have
  been thinking of starting to use C/C++ instead, after all it's the "native
  language" of Win32. I'd like to stick to Ada, but..."
  
Perhaps using the automatic bindings generator would a good way to go. Certainly
handcrafting Ada bindings is a long and laborious task.

Dale




  reply	other threads:[~1998-08-06  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-06  0:00 About to give up i96danma
1998-08-06  0:00 ` Dale Stanbrough [this message]
1998-08-06  0:00   ` Peter Amey
1998-08-06  0:00     ` Tom Moran
1998-08-06  0:00 ` Oliver.Kellogg
1998-08-07  0:00   ` Tarjei Tj�stheim Jensen
  -- strict thread matches above, loose matches on Subject: below --
1998-08-16  0:00 Robert Dewar
1998-08-06  0:00 i96danma
1998-08-06  0:00 ` Robert Dewar
1998-08-08  0:00   ` Dan Mattsson
1998-08-10  0:00     ` Robert Dewar
1998-08-06  0:00 ` dennison
1998-08-07  0:00   ` i96danma
1998-08-07  0:00     ` Robert Dewar
1998-08-08  0:00       ` Dan Mattsson
1998-09-05  0:00         ` Tom Moran
1998-08-08  0:00       ` Matthew Heaney
1998-08-08  0:00         ` Robert Dewar
1998-08-08  0:00           ` Matthew Heaney
replies disabled

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