comp.lang.ada
 help / color / mirror / Atom feed
* Re: win32ada design question/problem
@ 1998-11-19  0:00 tmoran
  1998-11-19  0:00 ` dennison
  0 siblings, 1 reply; 10+ messages in thread
From: tmoran @ 1998-11-19  0:00 UTC (permalink / raw)


>   C_Function(S'Address);
>
>makes it clear that you are passing the whole of S.
> ....
>   C_Function(S(S'first)'Unchecked_Access);
>
>which does not make clear that S is passed as a whole.
   C_Function(Window_Name => S(S'first)'Unchecked_Access);
or
   C_Function(Control_Character => S(S'first)'Unchecked_Access);
Using a named parameter should make it clearer in either case.
A maintainer familiar with C would realize that all of S is
potentially accessible by S(S'first)'Unchecked_Access and would
have to look up C_Function to find out if it's acting on just
(S'first) or other parts of S.  Ditto S'Address.
(And of course S probably is intended to be an Interfaces.C.Char_Array,
not an Ada String.)

>- Try interfacing fcntl, setsockopt or some other weird functions using
>access types: these somtimes return, or take as a parameter, a pointer
>that points to a type that changes depending on the function you want to
>perform, which is determined by the value of another parameter. You can
>certainly do this with overloading, but I am not sure this buys much in
>a thin binding.
  This certainly happens, but relatively rarely.  I take it as yet
another argument against too-thin bindings.

>- It's the good old Ada 83 way that has worked for 15 years now, wo why
>change ?
  Actually, no. My first Ada 83 compiler used fat pointers for
unconstrained arrays and S'Address would not do what you expected in that
case - it was necessary to use S(S'first)'Address.
Tom Moran




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: win32ada design question/problem
  1998-11-19  0:00 win32ada design question/problem tmoran
@ 1998-11-19  0:00 ` dennison
  1998-11-19  0:00   ` Tom Moran
  0 siblings, 1 reply; 10+ messages in thread
From: dennison @ 1998-11-19  0:00 UTC (permalink / raw)


In article <731rn7$kj5@lotho.delphi.com>,
  tmoran@bix.com wrote:
> >- Try interfacing fcntl, setsockopt or some other weird functions using
> >access types: these somtimes return, or take as a parameter, a pointer
> >that points to a type that changes depending on the function you want to
> >perform, which is determined by the value of another parameter. You can
> >certainly do this with overloading, but I am not sure this buys much in
> >a thin binding.
>   This certainly happens, but relatively rarely.  I take it as yet
> another argument against too-thin bindings.

But there *has* to be a binding at this level somewhere! It might not be
directly called by most users, but it still has to be there.

--
T.E.D.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: win32ada design question/problem
  1998-11-19  0:00 ` dennison
@ 1998-11-19  0:00   ` Tom Moran
  1998-11-20  0:00     ` dennison
  1998-11-23  0:00     ` win32ada design question/problem Marin David Condic
  0 siblings, 2 replies; 10+ messages in thread
From: Tom Moran @ 1998-11-19  0:00 UTC (permalink / raw)


>But there *has* to be a binding at this level somewhere! It might not be
>directly called by most users, but it still has to be there.
Clearly.  But also clearly such 'dirty work' should be encapsulated
inside a pretty, understandable, robust, etc box.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: win32ada design question/problem
  1998-11-19  0:00   ` Tom Moran
@ 1998-11-20  0:00     ` dennison
  1998-11-20  0:00       ` Tom Moran
  1998-11-20  0:00       ` Ada Source Treasury (Re: win32ada design question/problem) David Botton
  1998-11-23  0:00     ` win32ada design question/problem Marin David Condic
  1 sibling, 2 replies; 10+ messages in thread
From: dennison @ 1998-11-20  0:00 UTC (permalink / raw)


In article <3654a7f3.11586041@news.pacbell.net>,
  tmoran@bix.com (Tom Moran) wrote:
> >But there *has* to be a binding at this level somewhere! It might not be
> >directly called by most users, but it still has to be there.
> Clearly.  But also clearly such 'dirty work' should be encapsulated
> inside a pretty, understandable, robust, etc box.
>

That I can agree with. The dirty work should be buried somewhere and given a
nice safe (hopefully fully-functional) interface. That's the first thing I do
when I have to make OS calls. I don't use Win32 Ada at the moment, but if I
did I'd probably just make my own high-level packages for the routines I
need, and paste the relevent Win32 bindings into the package bodies. I did
exactly that with the DDE functionality a few years ago.

If I'm not unique in that respect, perhaps it would be a good idea to set up a
place to accumulate everyone's high-level bindings. Something more ambitious
could be setup later. Simply making them available so there isn't a horrible
amount of duplication going on would be a worthy effort.

I'd consider contributing, but I don't use Win32, and I won't as long as I
can't legaly do it.

--
T.E.D.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Ada Source Treasury (Re: win32ada design question/problem)
  1998-11-20  0:00     ` dennison
  1998-11-20  0:00       ` Tom Moran
@ 1998-11-20  0:00       ` David Botton
  1998-11-22  0:00         ` Jerry van Dijk
  1 sibling, 1 reply; 10+ messages in thread
From: David Botton @ 1998-11-20  0:00 UTC (permalink / raw)


I am willing to donate the place and space. I am currently working on creating
what I call the "Ada Source Code Treasury". I asked a while back if such a thing
existed and no one said "yup" so I assume it doesn't exist. Your self or any one
interested in contributing Ada 95 source code or How-To articles please send to:

AdaSource@botton.com

There isn't much to see yet (the current location is www.botton.com/ada) and
other then the links page there are just alot of broken links. (This Sun. I plan
on creating alot of example code for the Ada language area and if time permits
one or two examples of writing bindings to Unix and Win32). I just started this
mid-week, so please check back often for its growth. All ideas are welcome.

I hope to spend time creating example code for just about anything I can think
of.
It is my hopes that questions like how do I convert from a String to an Integer
can be directed with a URL there along with How do I create linked lists and How
do I send and receive MSMQ messages using Ada?

I hope to have some informative text with sample source in addition to just
bindings and packages that can be reused.

David Botton



> If I'm not unique in that respect, perhaps it would be a good idea to set up a
> place to accumulate everyone's high-level bindings. Something more ambitious
> could be setup later. Simply making them available so there isn't a horrible
> amount of duplication going on would be a worthy effort.
>
> I'd consider contributing, but I don't use Win32, and I won't as long as I
> can't legaly do it.
>
> --
> T.E.D.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own







^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: win32ada design question/problem
  1998-11-20  0:00     ` dennison
@ 1998-11-20  0:00       ` Tom Moran
  1998-11-20  0:00       ` Ada Source Treasury (Re: win32ada design question/problem) David Botton
  1 sibling, 0 replies; 10+ messages in thread
From: Tom Moran @ 1998-11-20  0:00 UTC (permalink / raw)


>Simply making them available so there isn't a horrible
>amount of duplication going on would be a worthy effort.
The 1997 TriAda paper I coauthored discusses high level bindings in
Ada 95 to Windows and you can see some of the results in the source
subset of Claw and its demos.  These things are reachable via
www.rrsoftware.com  (and I understand updated demos are in the hands
of the webmaster and should be up shortly).




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada Source Treasury (Re: win32ada design question/problem)
  1998-11-20  0:00       ` Ada Source Treasury (Re: win32ada design question/problem) David Botton
@ 1998-11-22  0:00         ` Jerry van Dijk
  0 siblings, 0 replies; 10+ messages in thread
From: Jerry van Dijk @ 1998-11-22  0:00 UTC (permalink / raw)



David Botton <David@Botton.com> schreef in artikel
<3655AF1F.9768F70D@Botton.com>...
> I am willing to donate the place and space. I am currently working on
creating
> what I call the "Ada Source Code Treasury". I asked a while back if such
a thing
> existed and no one said "yup" so I assume it doesn't exist. Your self or
any one
> interested in contributing Ada 95 source code or How-To articles please
send to:
> 
> AdaSource@botton.com

Hope you check my homepage first, before you duplicate some the stuff
already there...

-- 
-- Jerry van Dijk | Leiden, Holland
-- Team Ada       | email: jdijk@acm.org
-- Ada & Win32: http://stad.dsl.nl/~jvandyk





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: win32ada design question/problem
  1998-11-19  0:00   ` Tom Moran
  1998-11-20  0:00     ` dennison
@ 1998-11-23  0:00     ` Marin David Condic
  1998-11-23  0:00       ` Mats Weber
  1 sibling, 1 reply; 10+ messages in thread
From: Marin David Condic @ 1998-11-23  0:00 UTC (permalink / raw)


Tom Moran wrote:

> >But there *has* to be a binding at this level somewhere! It might not be
> >directly called by most users, but it still has to be there.
> Clearly.  But also clearly such 'dirty work' should be encapsulated
> inside a pretty, understandable, robust, etc box.

I'd agree - to a point. It would be nice to have a very-thick sort of binding
to the Win32api, such as CLAW, which is a shot at creating its own windows
interface paradigm. (From my casual inspection, it is a much better job than
the organically-grown Win32api!) However, if you get serious about any sort
of Win32api programming, you are going to occasionally need to go past any
thick binding right to the original source. (A little analogous to dipping
into assembler.) Here' I'd like to have a slightly meatier interface than the
Win32Ada interface which simply organized the types and parameters the way an
Ada programmer would expect to see them, then having the binding translate to
the low level Win32Ada code. Maybe we call it Win32Ada++?)

MDC

--
Marin David Condic
===========================================================
    "A government that is big enough to give you all you want is big
    enough to take it all away."

        --  Barry Goldwater
===========================================================






^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: win32ada design question/problem
  1998-11-23  0:00     ` win32ada design question/problem Marin David Condic
@ 1998-11-23  0:00       ` Mats Weber
  1998-11-24  0:00         ` dennison
  0 siblings, 1 reply; 10+ messages in thread
From: Mats Weber @ 1998-11-23  0:00 UTC (permalink / raw)


Marin David Condic wrote:

> [...] Here' I'd like to have a slightly meatier interface than the
> Win32Ada interface which simply organized the types and parameters the way an
> Ada programmer would expect to see them, then having the binding translate to
> the low level Win32Ada code. Maybe we call it Win32Ada++?)

The problem with this beautiful idea is that it is never going to
happen. Look at POSIX 1003.5: it's hard to find a working implementation
even now, years after the IEEE standard was accepted. People just can't
wait for such bindings to come out, so I think we must still produce
thin automatically generated bindings so that they become available
shortly after the product that they interface. This is especially true
for Windows, which changes very often.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: win32ada design question/problem
  1998-11-23  0:00       ` Mats Weber
@ 1998-11-24  0:00         ` dennison
  0 siblings, 0 replies; 10+ messages in thread
From: dennison @ 1998-11-24  0:00 UTC (permalink / raw)


In article <3659963D.1D186DDF@elca-matrix.ch>,
  Mats.Weber@elca-matrix.ch wrote:

> even now, years after the IEEE standard was accepted. People just can't
> wait for such bindings to come out, so I think we must still produce
> thin automatically generated bindings so that they become available
> shortly after the product that they interface. This is especially true
> for Windows, which changes very often.

Complete thin bindings are also very useful for developing thicker bindings.
It saves a lot of time to be able to paste the relevent declaration into my
code. I usually have to change it a bit, but its a lot better than doing it
by hand from scratch.

--
T.E.D.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~1998-11-24  0:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-19  0:00 win32ada design question/problem 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-20  0:00       ` Ada Source Treasury (Re: win32ada design question/problem) David Botton
1998-11-22  0:00         ` Jerry van Dijk
1998-11-23  0:00     ` win32ada design question/problem Marin David Condic
1998-11-23  0:00       ` Mats Weber
1998-11-24  0:00         ` dennison

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