comp.lang.ada
 help / color / mirror / Atom feed
* Re: Binding a type to a union.
  1999-11-23  0:00 Aidan Skinner
@ 1999-11-22  0:00 ` David Botton
  0 siblings, 0 replies; 25+ messages in thread
From: David Botton @ 1999-11-22  0:00 UTC (permalink / raw)


You would do the following:

type foo_struct is
   record
      x : C.Int;
   end record;

type bar_struct is
   record
      x : C.char;
      y : some_enum_type;
   end record;

subtype Union_1_Range is Positive range 1..2;

type Union_1 (Which : Union_1_Range) is
   record
      case Which is
         when 1 =>
            foo : foo_struct;
         when 2 =>
            bar : bar_struct;
   end record;
pragma Unchecked_Union(Union_1);

type foo_type is
   record
     foo_bar : Union_1;
    end record;


Then you can access using:

my : foo_type;

my.foo_bar.foo.x := 1;

etc.

David Botton


Aidan Skinner wrote in message ...
>Can anybody tell me the correct way to give an Ada representation of a
>C union contained in a structure?
>
>Eg given a declaration in C of:
>
>struct foo
> {
>
>   union
>   {
>     struct
>     {
>       int x;
>     } foo
>
>     struct
>     {
>       char x;
>       some_enum_type y;
>     } bar
>
>   } foo_bar
> }
>
>What's the correct way of doing this given that x needs to be
>public?
>
>- Aidan







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

* Re: Binding a type to a union.
  1999-11-23  0:00 Tom_Hargraves
@ 1999-11-23  0:00 ` Matthew Heaney
  1999-11-23  0:00   ` Robert Dewar
  1999-11-23  0:00   ` David Botton
  1999-11-23  0:00 ` Robert Dewar
  1 sibling, 2 replies; 25+ messages in thread
From: Matthew Heaney @ 1999-11-23  0:00 UTC (permalink / raw)


In article <OF1AE825B1.88FF8CF8-ON88256832.005C894B@ray.ca> , 
Tom_Hargraves@Raytheon.com  wrote:

> However, wouldn't its use be restricted to when the type was to be used in a
> 'C' language interface call?

Why else would you need an union type?

If you don't need a union, then just use a discriminated (variant)
record.


> The pragma comes with a long list of restrictions which perhaps, generally,
> would be undesirable.

The restrictions are there to simplify the semantics of a union, which
is not a native Ada type.  (pragma Unchecked_Union is GNAT-specific.)


--
Help keep evolution in the science classroom and religion out: become a
member of the National Center for Science Education.

<http://www.natcenscied.org/>





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

* Re: Binding a type to a union.
  1999-11-23  0:00 Tom_Hargraves
  1999-11-23  0:00 ` Matthew Heaney
@ 1999-11-23  0:00 ` Robert Dewar
  1 sibling, 0 replies; 25+ messages in thread
From: Robert Dewar @ 1999-11-23  0:00 UTC (permalink / raw)


In article <OF1AE825B1.88FF8CF8-ON88256832.005C894B@ray.ca>,
  comp.lang.ada@ada.eu.org wrote:
> The pragma comes with a long list of restrictions which
> perhaps, generally, would be undesirable.

From an Ada point of view, the entire pragma is horribly unsafe,
and not something we want to see used in Ada code at all, so the
only legitimate use is in the interfacing context.


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Binding a type to a union.
  1999-11-23  0:00 ` Matthew Heaney
@ 1999-11-23  0:00   ` Robert Dewar
  1999-11-24  0:00     ` Aidan Skinner
  1999-11-24  0:00     ` Larry Kilgallen
  1999-11-23  0:00   ` David Botton
  1 sibling, 2 replies; 25+ messages in thread
From: Robert Dewar @ 1999-11-23  0:00 UTC (permalink / raw)


In article <383ae9f8_3@news1.prserv.net>,
  "Matthew Heaney" <matthew_heaney@acm.org> wrote:
 (pragma Unchecked_Union is GNAT-specific.)

No it isn't!


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Binding a type to a union.
  1999-11-24  0:00     ` Larry Kilgallen
@ 1999-11-23  0:00       ` Tom Hargraves
  1999-11-24  0:00         ` tmoran
  1999-11-25  0:00         ` Robert Dewar
  1999-11-25  0:00       ` Robert Dewar
  1 sibling, 2 replies; 25+ messages in thread
From: Tom Hargraves @ 1999-11-23  0:00 UTC (permalink / raw)


Hi Larry,
I, like you, failed to find any reference to this pragma in the Ada LRM. The
reason is...

It is very well described in the Gnat Reference Manual, as an
_implementation-defined_ pragma.
Hence, I presume,  the assertion that it is a Gnat specific pragma (unless
another vendor has also choosen to implement it??).

Its use may be a little worrying if you have portability issues to consider,
to target platforms not supported by Gnat.

Hope this helps,
Tom H.

<I wish I had one of those quote generators>


Larry Kilgallen <kilgallen@eisner.decus.org> wrote in message
news:1999Nov23.215123.1@eisner...
> In article <81f3qe$jln$1@nnrp1.deja.com>, Robert Dewar
<robert_dewar@my-deja.com> writes:
> > In article <383ae9f8_3@news1.prserv.net>,
> >   "Matthew Heaney" <matthew_heaney@acm.org> wrote:
> >  (pragma Unchecked_Union is GNAT-specific.)
> >
> > No it isn't!
>
> It does not seem to be in the LRM index as published by IIT Research.
>
> Where else would one look it up ?
>
> Larry Kilgallen






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

* Binding a type to a union.
@ 1999-11-23  0:00 Aidan Skinner
  1999-11-22  0:00 ` David Botton
  0 siblings, 1 reply; 25+ messages in thread
From: Aidan Skinner @ 1999-11-23  0:00 UTC (permalink / raw)


Can anybody tell me the correct way to give an Ada representation of a
C union contained in a structure?

Eg given a declaration in C of:
   
struct foo
 {

   union
   {
     struct
     {
       int x;
     } foo

     struct
     {
       char x;
       some_enum_type y;
     } bar

   } foo_bar
 }

What's the correct way of doing this given that x needs to be
public?

- Aidan
-- 
"I say we just bury him and eat dessert"
http://www.skinner.demon.co.uk/aidan/
OpenPGP Key Fingerprint: 9858 33E6 C755 7D34 B5C5  316D 9274 1343 FBE6 99D9




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

* Re: Binding a type to a union.
@ 1999-11-23  0:00 Tom_Hargraves
  1999-11-23  0:00 ` Matthew Heaney
  1999-11-23  0:00 ` Robert Dewar
  0 siblings, 2 replies; 25+ messages in thread
From: Tom_Hargraves @ 1999-11-23  0:00 UTC (permalink / raw)
  To: comp.lang.ada


Thanks for the example of pragma Unchecked_Union in your reply. I have learnt
another pragma today :-)

However, wouldn't its use be restricted to when the type was to be used in a
'C' language interface call?

The pragma comes with a long list of restrictions which perhaps, generally,
would be undesirable.

Yours curiously,
Tom H.



"David Botton" <David@Botton.com> on 11/22/99 07:55:33 PM


Please respond to comp.lang.ada@ada.eu.org

From:"David Botton" <David@Botton.com> on 11/22/99 07:55 PM



To:  comp.lang.ada@ada.eu.org
cc:  (bcc: Tom Hargraves/RMD/Raytheon/CA)

Subject:  Re: Binding a type to a union.







You would do the following:

type foo_struct is
   record
      x : C.Int;
   end record;

type bar_struct is
   record
      x : C.char;
      y : some_enum_type;
   end record;

subtype Union_1_Range is Positive range 1..2;

type Union_1 (Which : Union_1_Range) is
   record
      case Which is
         when 1 =>
            foo : foo_struct;
         when 2 =>
            bar : bar_struct;
   end record;
pragma Unchecked_Union(Union_1);

type foo_type is
   record
     foo_bar : Union_1;
    end record;


Then you can access using:

my : foo_type;

my.foo_bar.foo.x := 1;

etc.

David Botton


Aidan Skinner wrote in message ...
>Can anybody tell me the correct way to give an Ada representation of a
>C union contained in a structure?
>
>Eg given a declaration in C of:
>
>struct foo
> {
>
>   union
>   {
>     struct
>     {
>       int x;
>     } foo
>
>     struct
>     {
>       char x;
>       some_enum_type y;
>     } bar
>
>   } foo_bar
> }
>
>What's the correct way of doing this given that x needs to be
>public?
>
>- Aidan




_______________________________________________
comp.lang.ada mailing list
comp.lang.ada@ada.eu.org
http://ada.eu.org/cgi-bin/mailman/listinfo/comp.lang.ada









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

* Re: Binding a type to a union.
  1999-11-23  0:00 ` Matthew Heaney
  1999-11-23  0:00   ` Robert Dewar
@ 1999-11-23  0:00   ` David Botton
  1999-11-24  0:00     ` Ted Dennison
  1 sibling, 1 reply; 25+ messages in thread
From: David Botton @ 1999-11-23  0:00 UTC (permalink / raw)


Many of my bindings use the pragma and they work on non-GNAT compilers.

DB

Matthew Heaney wrote in message <383ae9f8_3@news1.prserv.net>...
  (pragma Unchecked_Union is GNAT-specific.)







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

* Re: Binding a type to a union.
  1999-11-23  0:00   ` Robert Dewar
@ 1999-11-24  0:00     ` Aidan Skinner
  1999-11-24  0:00     ` Larry Kilgallen
  1 sibling, 0 replies; 25+ messages in thread
From: Aidan Skinner @ 1999-11-24  0:00 UTC (permalink / raw)


On Tue, 23 Nov 1999 22:18:01 GMT, Robert Dewar
<robert_dewar@my-deja.com> wrote: 

>In article <383ae9f8_3@news1.prserv.net>,
>  "Matthew Heaney" <matthew_heaney@acm.org> wrote:
> (pragma Unchecked_Union is GNAT-specific.)
>
>No it isn't!

It isn't, however, part of the ARM AFAICT, which is why I didn't find
it. 

While it's probably portable to most compilers, it isn't strictly
portable (ie you can't *depend* on it being there in all
implementations, even conforming ones that implement annex B).

This isn't a concern in my case, since I'm building a binding to GNOME
and it's relatively reasonable IMO to expect the compiler to be GNAT
on the architectures which GNOME suppourts (most unicen).

- Aidan
-- 
"I say we just bury him and eat dessert"
http://www.skinner.demon.co.uk/aidan/
OpenPGP Key Fingerprint: 9858 33E6 C755 7D34 B5C5  316D 9274 1343 FBE6 99D9




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

* Re: Binding a type to a union.
  1999-11-23  0:00   ` Robert Dewar
  1999-11-24  0:00     ` Aidan Skinner
@ 1999-11-24  0:00     ` Larry Kilgallen
  1999-11-23  0:00       ` Tom Hargraves
  1999-11-25  0:00       ` Robert Dewar
  1 sibling, 2 replies; 25+ messages in thread
From: Larry Kilgallen @ 1999-11-24  0:00 UTC (permalink / raw)


In article <81f3qe$jln$1@nnrp1.deja.com>, Robert Dewar <robert_dewar@my-deja.com> writes:
> In article <383ae9f8_3@news1.prserv.net>,
>   "Matthew Heaney" <matthew_heaney@acm.org> wrote:
>  (pragma Unchecked_Union is GNAT-specific.)
> 
> No it isn't!

It does not seem to be in the LRM index as published by IIT Research.

Where else would one look it up ?

Larry Kilgallen




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

* Re: Binding a type to a union.
  1999-11-23  0:00       ` Tom Hargraves
@ 1999-11-24  0:00         ` tmoran
  1999-11-25  0:00         ` Robert Dewar
  1 sibling, 0 replies; 25+ messages in thread
From: tmoran @ 1999-11-24  0:00 UTC (permalink / raw)


>Its use may be a little worrying if you have portability issues to consider,
Often you have just one, or very few, objects of the schizophrenic type,
in which case you might prefer:

with ada.text_io;
with interfaces.c,
     system.address_to_access_conversions;
procedure foobar is
use interfaces;

type foo_struct is
   record
      x : C.Int;
   end record;
for foo_struct use record
  x at 0 range 0 .. 31;
end record;
for foo_struct'size use 32;

type some_enum_type is (a,b);

type bar_struct is
   record
      x : C.char;
      y : some_enum_type;
   end record;
for bar_struct use record
  x at 0 range 0 .. 7;
  y at 1 range 0 .. 7;
end record;
for bar_struct'size use 32;

package foo_locs is new system.address_to_access_conversions(foo_struct);

--Then you can make a foo and a bar at the same place in memory.
-- (See Cohen, 2nd Edition, section 19.3 for some warnings)

foo : aliased foo_struct;
foo_loc : constant system.address := foo_locs.to_address(foo'access);
bar : bar_struct;
for bar'address use foo_loc;

begin

  foo.x := 3;
  bar.y := b;

  ada.text_io.put_line(c.int'image(foo.x));

end foobar;




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

* Re: Binding a type to a union.
  1999-11-23  0:00   ` David Botton
@ 1999-11-24  0:00     ` Ted Dennison
  1999-11-25  0:00       ` Robert Dewar
  0 siblings, 1 reply; 25+ messages in thread
From: Ted Dennison @ 1999-11-24  0:00 UTC (permalink / raw)


In article <81fbv1$uo8$1@news.gate.net>,
  "David Botton" <David@Botton.com> wrote:
> Many of my bindings use the pragma and they work on non-GNAT
> compilers.

Perhaps that's because compilers ignore pragmas they don't recognize.
Just for fun, try putting a "pragma Foo_Bar;" in one of your source
files and compile it with Gnat. The worst you'll see is a:
   warning: unrecognized pragma "Foo_Bar"


--
T.E.D.


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Binding a type to a union.
  1999-11-24  0:00     ` Larry Kilgallen
  1999-11-23  0:00       ` Tom Hargraves
@ 1999-11-25  0:00       ` Robert Dewar
  1999-11-25  0:00         ` Larry Kilgallen
  1999-11-29  0:00         ` Ted Dennison
  1 sibling, 2 replies; 25+ messages in thread
From: Robert Dewar @ 1999-11-25  0:00 UTC (permalink / raw)


In article <1999Nov23.215123.1@eisner>,
  Kilgallen@eisner.decus.org.nospam wrote:
> In article <81f3qe$jln$1@nnrp1.deja.com>, Robert Dewar
<robert_dewar@my-deja.com> writes:
> > In article <383ae9f8_3@news1.prserv.net>,
> >   "Matthew Heaney" <matthew_heaney@acm.org> wrote:
> >  (pragma Unchecked_Union is GNAT-specific.)
> >
> > No it isn't!
>
> It does not seem to be in the LRM index as published by IIT
Research.
>
> Where else would one look it up ?


No one said this was a standard pragma, it is not! All I said
was that it was not GNAT specific. Look it up in the Aonix
documentation, or the GNAT documentation, or the Greenhills
documentation etc. The GNAT implementation is slightly more
restrictive than the Intermetrics one I believe.


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Binding a type to a union.
  1999-11-23  0:00       ` Tom Hargraves
  1999-11-24  0:00         ` tmoran
@ 1999-11-25  0:00         ` Robert Dewar
  1 sibling, 0 replies; 25+ messages in thread
From: Robert Dewar @ 1999-11-25  0:00 UTC (permalink / raw)


In article <383b8e49@rsl2.rslnet.net>,
  "Tom Hargraves" <tharg@vtcinet.com> wrote:
> Hi Larry,
> I, like you, failed to find any reference to this pragma in
the Ada LRM. The
> reason is...
>
> It is very well described in the Gnat Reference Manual, as an
> _implementation-defined_ pragma.
> Hence, I presume,  the assertion that it is a Gnat specific
pragma

Well this does not follow. In fact the Unchecked_Union pragma
is one that has been proposed for semi-standardization and which
is implemented by a number of compilers. Any compiler serious
about interfacing to C should be implement at least the basic
functionality of this pragma


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Binding a type to a union.
  1999-11-24  0:00     ` Ted Dennison
@ 1999-11-25  0:00       ` Robert Dewar
  0 siblings, 0 replies; 25+ messages in thread
From: Robert Dewar @ 1999-11-25  0:00 UTC (permalink / raw)


In article <81gtd5$rfb$1@nnrp1.deja.com>,
  Ted Dennison <dennison@telepath.com> wrote:
> Perhaps that's because compilers ignore pragmas they don't
recognize.
> Just for fun, try putting a "pragma Foo_Bar;" in one of your
source
> files and compile it with Gnat. The worst you'll see is a:
>    warning: unrecognized pragma "Foo_Bar --
> T.E.D.

Well I assume this is a joke, but I did not see a smiley. Of
COURSE it is the case that if you use Unchecked_Union to
interface to a C union, and it was not implemented, then your
program wouldn't work.

And if indeed the above was intended to be serious, then please
note that a small amount of research would have shown you that
most Ada 95 compilers implement this pragma. It was one of the
first bits of extended Ada language technology agreed on by the
ARA technical committee, and has since been discussed by the ARG
as a possible semi-standard extension.


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Binding a type to a union.
  1999-11-25  0:00       ` Robert Dewar
@ 1999-11-25  0:00         ` Larry Kilgallen
  1999-11-25  0:00           ` Ed Falis
  1999-11-29  0:00         ` Ted Dennison
  1 sibling, 1 reply; 25+ messages in thread
From: Larry Kilgallen @ 1999-11-25  0:00 UTC (permalink / raw)


In article <81ignc$gb$1@nnrp1.deja.com>, Robert Dewar <robert_dewar@my-deja.com> writes:
> In article <1999Nov23.215123.1@eisner>,
>   Kilgallen@eisner.decus.org.nospam wrote:
>> In article <81f3qe$jln$1@nnrp1.deja.com>, Robert Dewar
> <robert_dewar@my-deja.com> writes:
>> > In article <383ae9f8_3@news1.prserv.net>,
>> >   "Matthew Heaney" <matthew_heaney@acm.org> wrote:
>> >  (pragma Unchecked_Union is GNAT-specific.)
>> >
>> > No it isn't!
>>
>> It does not seem to be in the LRM index as published by IIT
> Research.
>>
>> Where else would one look it up ?
> 
> 
> No one said this was a standard pragma, it is not! All I said
> was that it was not GNAT specific. Look it up in the Aonix
> documentation, or the GNAT documentation, or the Greenhills
> documentation etc. The GNAT implementation is slightly more
> restrictive than the Intermetrics one I believe.

It must be a _lot_ more _documented_, as I find no reference in the
Aonix Annex M section on Implementation-define pragmas (page 1-3
of UD/UG/A0000-05625/001, dated Mar97, the most recent version
distributed by Aonix to subscription customers).

Larry Kilgallen




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

* Re: Binding a type to a union.
  1999-11-25  0:00         ` Larry Kilgallen
@ 1999-11-25  0:00           ` Ed Falis
  1999-11-25  0:00             ` Larry Kilgallen
  0 siblings, 1 reply; 25+ messages in thread
From: Ed Falis @ 1999-11-25  0:00 UTC (permalink / raw)


On Thu, 25 Nov 1999 14:12:01 GMT, kilgallen@eisner.decus.org (Larry Kilgallen) wrote:

> > 
> > No one said this was a standard pragma, it is not! All I said
> > was that it was not GNAT specific. Look it up in the Aonix
> > documentation, or the GNAT documentation, or the Greenhills
> > documentation etc. The GNAT implementation is slightly more
> > restrictive than the Intermetrics one I believe.
> 
> It must be a _lot_ more _documented_, as I find no reference in the
> Aonix Annex M section on Implementation-define pragmas (page 1-3
> of UD/UG/A0000-05625/001, dated Mar97, the most recent version
> distributed by Aonix to subscription customers).
> 
> Larry Kilgallen

Thanks for pointing out the error in Annex M - I'll file a documentation problem
report.

Unchecked_Union and C_Pass_by_Copy are documented in the "Tour of 
ObjectAda" document in the section on interfacing to other languages.

- Ed





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

* Re: Binding a type to a union.
  1999-11-25  0:00           ` Ed Falis
@ 1999-11-25  0:00             ` Larry Kilgallen
  1999-11-25  0:00               ` Robert Dewar
  0 siblings, 1 reply; 25+ messages in thread
From: Larry Kilgallen @ 1999-11-25  0:00 UTC (permalink / raw)


In article <1103_943541468@DZOG-CHEN>, falis@ma.aonix.com (Ed Falis) writes:
> On Thu, 25 Nov 1999 14:12:01 GMT, kilgallen@eisner.decus.org (Larry Kilgallen) wrote:
> 
>> > 
>> > No one said this was a standard pragma, it is not! All I said
>> > was that it was not GNAT specific. Look it up in the Aonix
>> > documentation, or the GNAT documentation, or the Greenhills
>> > documentation etc. The GNAT implementation is slightly more
>> > restrictive than the Intermetrics one I believe.
>> 
>> It must be a _lot_ more _documented_, as I find no reference in the
>> Aonix Annex M section on Implementation-define pragmas (page 1-3
>> of UD/UG/A0000-05625/001, dated Mar97, the most recent version
>> distributed by Aonix to subscription customers).
>> 
>> Larry Kilgallen
> 
> Thanks for pointing out the error in Annex M - I'll file a documentation problem
> report.
> 
> Unchecked_Union and C_Pass_by_Copy are documented in the "Tour of 
> ObjectAda" document in the section on interfacing to other languages.

Indeed, now that you point them out, I find them in that document.
It does require turning to the right section, as that document
has no index at all.  But what would really be required for an
efficient lookup would be a master index covering all 12 of the
ObjectAda documents, and even my favorite documentation tool does
not handle the Master Index problem adequately.

=====

It might be good if Ada implementors when documenting pragmas
that are implementation-defined could indicate that they know
of other implementations of a pragma by the same name.

Given Robert's comment about variations in the degree of
restriction on this pragma between implementations, what
is the general process by which people see a useful but
not standard pragma evolving into a standard one (not
this paragma in particular).  Will we ultimately likely
see the more-restrictive or the less-restrictive variant
adopted ?

Larry Kilgallen




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

* Re: Binding a type to a union.
  1999-11-25  0:00             ` Larry Kilgallen
@ 1999-11-25  0:00               ` Robert Dewar
  0 siblings, 0 replies; 25+ messages in thread
From: Robert Dewar @ 1999-11-25  0:00 UTC (permalink / raw)


In article <1999Nov25.113617.1@eisner>,
  Kilgallen@eisner.decus.org.nospam wrote:
> Given Robert's comment about variations in the degree of
> restriction on this pragma between implementations, what
> is the general process by which people see a useful but
> not standard pragma evolving into a standard one (not
> this paragma in particular).

The ARG discusses such issues as part of its role in maintaining
the Ada standard, the relevant AI's are available online
somewhere :-)

> Will we ultimately likely
> see the more-restrictive or the less-restrictive variant
> adopted ?

Who knows? GNAT provides the minimal version which is sufficient
for interfacing to C, we decline to make it more general, since
we don't think it should be used in any other context. Tuck's
taste is to make the pragma much more general, and that is how
it is implemented in the Intermetrics front end. Who knows what
the ARG will finally agree on, and that's only the first step
anyway?



>
> Larry Kilgallen
>


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* RE: Binding a type to a union.
@ 1999-11-26  0:00 Robert C. Leif, Ph.D.
  1999-11-28  0:00 ` Robert Dewar
  0 siblings, 1 reply; 25+ messages in thread
From: Robert C. Leif, Ph.D. @ 1999-11-26  0:00 UTC (permalink / raw)
  To: comp.lang.ada

From : Bob Leif
To: Robert Dewar et al.

I am gratified that "the extended Ada language technology agreed on by the
ARA technical committee, and has since been discussed by the ARG
as a possible semi-standard extension."

Finally, Ada has some flexibility and adaptability! I hope that 1) the ARA
and ARG can define a process for extending Ada and a better term than "a
possible semi-standard extension." 2) That these semi-standard extensions
keep being created as required with or without a formal process. and 3) An
informal process, at least initially, be set up where we the users can make
suggestions for these "semi-standard extensions."

I like the term provisional extensions. You can even follow the present
commercial software terminology. We could have alpha and beta levels. When
an extension is accepted by ISO, it becomes gold.

-----Original Message-----
From: Robert Dewar [mailto:robert_dewar@my-deja.com]
Sent: Wednesday, November 24, 1999 9:21 PM
To: comp.lang.ada@ada.eu.org
Subject: Re: Binding a type to a union.


In article <81gtd5$rfb$1@nnrp1.deja.com>,
  Ted Dennison <dennison@telepath.com> wrote:
> Perhaps that's because compilers ignore pragmas they don't
recognize.
> Just for fun, try putting a "pragma Foo_Bar;" in one of your
source
> files and compile it with Gnat. The worst you'll see is a:
>    warning: unrecognized pragma "Foo_Bar --
> T.E.D.

Well I assume this is a joke, but I did not see a smiley. Of
COURSE it is the case that if you use Unchecked_Union to
interface to a C union, and it was not implemented, then your
program wouldn't work.

And if indeed the above was intended to be serious, then please
note that a small amount of research would have shown you that
most Ada 95 compilers implement this pragma. It was one of the
first bits of extended Ada language technology agreed on by the
ARA technical committee, and has since been discussed by the ARG
as a possible semi-standard extension.


Sent via Deja.com http://www.deja.com/
Before you buy.








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

* RE: Binding a type to a union.
  1999-11-26  0:00 Binding a type to a union Robert C. Leif, Ph.D.
@ 1999-11-28  0:00 ` Robert Dewar
  1999-11-28  0:00   ` Vladimir Olensky
  0 siblings, 1 reply; 25+ messages in thread
From: Robert Dewar @ 1999-11-28  0:00 UTC (permalink / raw)


In article <NBBBJNOMKDIAJALCEFIJEEMEDFAA.rleif@rleif.com>,
  comp.lang.ada@ada.eu.org wrote:
> 3) An
> informal process, at least initially, be set up where we the
> users can make
> suggestions for these "semi-standard extensions."

The informal process is to convince at least one vendor to
pursue your idea, at the moment the extensions are being
driven primarily by customer input to vendors, we are certainly
not in the mode of asking the community for neat ideas!


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Binding a type to a union.
  1999-11-28  0:00 ` Robert Dewar
@ 1999-11-28  0:00   ` Vladimir Olensky
  1999-12-01  0:00     ` Robert Dewar
  1999-12-01  0:00     ` Robert Dewar
  0 siblings, 2 replies; 25+ messages in thread
From: Vladimir Olensky @ 1999-11-28  0:00 UTC (permalink / raw)



Robert Dewar wrote in message <81pum2$s1a$1@nnrp1.deja.com>...

[..]
>  ...  at the moment the extensions are being
>driven primarily by customer input to vendors, we are certainly
>not in the mode of asking the community for neat ideas!


I think this  is one  of the biggest problems for Ada in general
and it stems from  the fact that for a long period of time Ada
was sponsored by DoD and Ada business was done in
a closed market.

This approach may be of some value as a short term tactic
but as a long term strategy it leads nowhere.

This is the ABC of the Hi-Tech  business that in order in succeed
in a long run a company should invest some part of it's profits
into research and development  area (including  possible markets ,
technology areas, new products, new trends that soon become
a market demand etc.).
Even if (5-10)% of such investments would outcome in something
useful that is a little bit ahead of the time (and competitors's
products )  then that investments  would be much rewarded.

If a company fails in this area then regardless of how good was
it's  initial position it will lose the game as in a long run it would be
lagging behind others.

There are many examples when companies founded by persons
genuine  in science in technologies  failed as the same person was
defining company market approach  (please, please  do not think
that I am talking about ACT - I am talking in general :-).
Genuine management is as important for successful business
as all other aspects of business.

Approach described as "first money - than new product for that
money" is a deadline in an open market business (in closed
market it works OK).
In an open market  the main rule is quite the opposite:
"first new product -  then money if  that product succeeds"

Regards,
Vladimir Olensky









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

* Re: Binding a type to a union.
  1999-11-25  0:00       ` Robert Dewar
  1999-11-25  0:00         ` Larry Kilgallen
@ 1999-11-29  0:00         ` Ted Dennison
  1 sibling, 0 replies; 25+ messages in thread
From: Ted Dennison @ 1999-11-29  0:00 UTC (permalink / raw)


In article <81ignc$gb$1@nnrp1.deja.com>,
  Robert Dewar <robert_dewar@my-deja.com> wrote:

> No one said this was a standard pragma, it is not! All I said
> was that it was not GNAT specific. Look it up in the Aonix
> documentation, or the GNAT documentation, or the Greenhills
> documentation etc. The GNAT implementation is slightly more

I don't see it in the Green Hills documentation that I have (version
1.8.9, just released a few months ago).

--
T.E.D.


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Binding a type to a union.
  1999-11-28  0:00   ` Vladimir Olensky
  1999-12-01  0:00     ` Robert Dewar
@ 1999-12-01  0:00     ` Robert Dewar
  1 sibling, 0 replies; 25+ messages in thread
From: Robert Dewar @ 1999-12-01  0:00 UTC (permalink / raw)


In article <s42fr6l7mvm75@corp.supernews.com>,
  "Vladimir Olensky" <vladimir_olensky@yahoo.com> wrote:

> This is the ABC of the Hi-Tech  business that in order in
> succeed in a long run a company should invest some part of
> it's profits into research and development  area (including
> possible markets , technology areas, new products, new trends
> that soon become a market demand etc.).
> Even if (5-10)% of such investments would outcome in something
> useful that is a little bit ahead of the time (and
> competitors's
> products )  then that investments  would be much rewarded.

Well of course! ACT invests FAR FAR more than 10% of its revenue
(you don't really mean profits here, that's not the relevant
figure at all!) in such research and development.

It is a big leap however to conclude that we should necessarily
spend thismoney in the way Vladimir thinks is a good idea :-)

Generally we don't find comp.lang.ada to be the place to look
for ideas on what the most important improvements to GNAT might
be. Instead we look to our own resources, and to suggestions
from customers whom we know and work with closely in this
regard.

As you know if you read the features file that comes with GNAT
releases, we add many new features to each new release. Some of
these ideas come from our own thoughts, some from suggestions
made from customers, some from suggestions made (to
report@gnat.com) from users of the public version.

But few if any from CLA, we just don't find it as very useful
sourceof ideas in practice!

 Sure, CLA is full of people who are
ABSOLUTELY SURE that Ada will succeed if only XXX is done
(you can fill in all kinds of things for XXX if you have
been reading this newsgroup for long), and often these
same people are ABSOLUTELY SURE that any company that does
not implement XXX just doesn't understand -- oh well it is
always easy to spend other people's money.

Actually in the case of GNAT, if you are really really sure
that XXX is the key factor to success, why not follow the
idea yourself, make a version of GNAT or an add on to GNAT
that implements XXX and do your thing :-)

If you do have a specific suggestion, by all means submit it
to Ada Core Technologies, by sending the suggestion in to
report@gnat.com. The important thing is to be as specific as
possible. Specific proposals are much more likely to be looked
at carefully!

Robert Dewar
Ada Core Technologies


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Binding a type to a union.
  1999-11-28  0:00   ` Vladimir Olensky
@ 1999-12-01  0:00     ` Robert Dewar
  1999-12-01  0:00     ` Robert Dewar
  1 sibling, 0 replies; 25+ messages in thread
From: Robert Dewar @ 1999-12-01  0:00 UTC (permalink / raw)


In article <s42fr6l7mvm75@corp.supernews.com>,
  "Vladimir Olensky" <vladimir_olensky@yahoo.com> wrote:
> Even if (5-10)% of such investments would outcome in something
> useful that is a little bit ahead of the time (and
competitors's
> products )  then that investments  would be much rewarded.


Sorry I did not see exactly what your 10% was referring to here.
I don't at all buy that we can afford to spend 90-95% of our
development time on failed ideas, and we definitely see nothing
like this in practice.

Some examples of features that were developed primarily from
internal ideas and suggestions at Ada Core Technologies using
only or mostly our own resources are:

1. The entire distributed annex
2. The static elaboration model
3. The new integrated development environment
4. ASIS-for-GNAT
5. GNORT
6. Much of the specialized NT support
7. The GNAT library, including especially the pattern stuff
8. JGNAT (GNAT for Java)

well this list could go on for a long time. I am sure that
there are those who will read this list and say, gee I really
think that they should have done XXX (my pet idea) instead
of N (choose a number from 1 to 8), but for sure all the above
have proved very important to at least some users and potential
users of the GNAT technology.

Robert Dewar
Ada Core Technologies


Sent via Deja.com http://www.deja.com/
Before you buy.




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

end of thread, other threads:[~1999-12-01  0:00 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-26  0:00 Binding a type to a union Robert C. Leif, Ph.D.
1999-11-28  0:00 ` Robert Dewar
1999-11-28  0:00   ` Vladimir Olensky
1999-12-01  0:00     ` Robert Dewar
1999-12-01  0:00     ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1999-11-23  0:00 Tom_Hargraves
1999-11-23  0:00 ` Matthew Heaney
1999-11-23  0:00   ` Robert Dewar
1999-11-24  0:00     ` Aidan Skinner
1999-11-24  0:00     ` Larry Kilgallen
1999-11-23  0:00       ` Tom Hargraves
1999-11-24  0:00         ` tmoran
1999-11-25  0:00         ` Robert Dewar
1999-11-25  0:00       ` Robert Dewar
1999-11-25  0:00         ` Larry Kilgallen
1999-11-25  0:00           ` Ed Falis
1999-11-25  0:00             ` Larry Kilgallen
1999-11-25  0:00               ` Robert Dewar
1999-11-29  0:00         ` Ted Dennison
1999-11-23  0:00   ` David Botton
1999-11-24  0:00     ` Ted Dennison
1999-11-25  0:00       ` Robert Dewar
1999-11-23  0:00 ` Robert Dewar
1999-11-23  0:00 Aidan Skinner
1999-11-22  0:00 ` David Botton

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