comp.lang.ada
 help / color / mirror / Atom feed
* stupid question
@ 2003-10-08  3:12 Shanon Fernald
  2003-10-08  3:31 ` James Rogers
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Shanon Fernald @ 2003-10-08  3:12 UTC (permalink / raw)


What programming language do you think would be best to use if you
were building the software to manage a nuclear power plant and why?
Which would let you sleep best at night knowing you lived next door to
the plant?



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

* Re: stupid question
  2003-10-08  3:12 stupid question Shanon Fernald
@ 2003-10-08  3:31 ` James Rogers
  2003-10-08  4:34 ` Steve
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 21+ messages in thread
From: James Rogers @ 2003-10-08  3:31 UTC (permalink / raw)


info@irvinehosting.net (Shanon Fernald) wrote in 
news:d8f235a4.0310071912.563d16ea@posting.google.com:

> What programming language do you think would be best to use if you
> were building the software to manage a nuclear power plant and why?
> Which would let you sleep best at night knowing you lived next door to
> the plant?
> 

Nuclear power plant software is extremely safety critical.
There are a number of required processes for creating software for
nuclear power plants. 

I would want a language that best supports safety critical software
development processes for the parts that actually control the operation
of the power plant. Almost anything can be used for the administrative
tasks such as employee records and trivial financial tracking. 

For the truly safety critical parts I would choose Spark.

Jim Rogers



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

* Re: stupid question
  2003-10-08  3:12 stupid question Shanon Fernald
  2003-10-08  3:31 ` James Rogers
@ 2003-10-08  4:34 ` Steve
  2003-10-08 12:54   ` Marin David Condic
  2003-10-08 13:01 ` Marin David Condic
  2003-10-08 22:18 ` Robert I. Eachus
  3 siblings, 1 reply; 21+ messages in thread
From: Steve @ 2003-10-08  4:34 UTC (permalink / raw)


"Shanon Fernald" <info@irvinehosting.net> wrote in message
news:d8f235a4.0310071912.563d16ea@posting.google.com...
> What programming language do you think would be best to use if you
> were building the software to manage a nuclear power plant and why?
> Which would let you sleep best at night knowing you lived next door to
> the plant?

Language: Spark
Reason: The language is designed for safety critical systems.
BTW: If I lived next to a nuclear power plant... I would relocate.

Steve
(The Duck)





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

* Re: stupid question
  2003-10-08  4:34 ` Steve
@ 2003-10-08 12:54   ` Marin David Condic
  0 siblings, 0 replies; 21+ messages in thread
From: Marin David Condic @ 2003-10-08 12:54 UTC (permalink / raw)


Or you could turn the nuclear power plant off. The switch is right on 
your wall. :-)

MDC


Steve wrote:
> BTW: If I lived next to a nuclear power plant... I would relocate.
> 
> Steve
> (The Duck)
> 
> 


-- 
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jsf.mil/NSFrames.htm

Send Replies To: m c o n d i c @ a c m . o r g

     "All reformers, however strict their social conscience,
      live in houses just as big as they can pay for."

          --Logan Pearsall Smith
======================================================================




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

* Re: stupid question
  2003-10-08  3:12 stupid question Shanon Fernald
  2003-10-08  3:31 ` James Rogers
  2003-10-08  4:34 ` Steve
@ 2003-10-08 13:01 ` Marin David Condic
  2003-10-08 22:18 ` Robert I. Eachus
  3 siblings, 0 replies; 21+ messages in thread
From: Marin David Condic @ 2003-10-08 13:01 UTC (permalink / raw)


I hope you're not trolling to see if you can start a language war. ;-)

Some have mentioned Spark - a subset of Ada. That has merit. I regularly 
build engine controls for jet and rocket engines using Ada - not the 
Spark subset. We don't use *all* features of Ada - usually for timing or 
sizing concerns or its just not in the nature of what we do. (Strings, 
for example, just aren't a big concern for an engine control.) We 
understand what things in the language may have some uncertainty or risk 
involved and make choices about what we use on a case-by-case basis.

In general we like Ada because of all the checking it does. (and other 
reasons, but for safety purposes, its the checking.) When we started 
using Ada we kept stats on defects found in the software and discovered 
that we had reduced error rates by a factor of four. We were building 
"safe" software before, but doing so with a much higher cost in testing 
and rework. Now, because we don't inject so many errors, its less 
expensive to make the software safe.

MDC



Shanon Fernald wrote:
> What programming language do you think would be best to use if you
> were building the software to manage a nuclear power plant and why?
> Which would let you sleep best at night knowing you lived next door to
> the plant?


-- 
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jsf.mil/NSFrames.htm

Send Replies To: m c o n d i c @ a c m . o r g

     "All reformers, however strict their social conscience,
      live in houses just as big as they can pay for."

          --Logan Pearsall Smith
======================================================================




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

* Re: stupid question
  2003-10-08  3:12 stupid question Shanon Fernald
                   ` (2 preceding siblings ...)
  2003-10-08 13:01 ` Marin David Condic
@ 2003-10-08 22:18 ` Robert I. Eachus
  2003-10-09 10:09   ` Steffen Huber
  3 siblings, 1 reply; 21+ messages in thread
From: Robert I. Eachus @ 2003-10-08 22:18 UTC (permalink / raw)


Shanon Fernald wrote:
> What programming language do you think would be best to use if you
> were building the software to manage a nuclear power plant and why?
> Which would let you sleep best at night knowing you lived next door to
> the plant?

My first choice would be "none."  There is no need to use software to 
control a nuclear reactor, and the safest nuclear reactors use that 
philosophy.  It is fine to use software to display the state of the 
reactor, calculate fuel burns and refueling patterns, and so on.  (My 
second choice would be SPARK, and it is certainly a reasonable choice 
for the software that controls the rest of the plant.)

For most nuclear reactors the response time to control inputs is 
measured in hours, and there are at most a dozen primary controls.  Yes, 
you can see the reactor begin to respond to control inputs in minutes, 
but the full response, even to a scram, takes hours to days.  A lot of 
people, including me, thought that the zirconium spacers that B&W used 
in the Three Mile Island reactors and a couple of others cut this 
"think" time to around eight minutes from say, four hours.  It did allow 
a few percentage points more of the fuel to be burned, but it didn't 
seem worth the agony relative to the Westinghouse PWR design.

GE reactors are boiling water reactors instead of pressurized water 
reactors.  I won't go into all the differences that makes, but it means 
that the water in the core is a mixture of steam and water when the 
reactor is running.  Since the reactor is designed with a negative void 
coefficient, and the steam is less dense than water, even under the 
reactor operating conditions, they are even more self-regulating.  With 
a BWR, if an operator makes one control change during his shift, it is 
probably to pretend that he has something to do other than to look at 
gages and check logs.

Liquid metal fast breeder reactors (LMFBRs) on the other hand may have 
response times to control inputs in seconds.  And with a positive void 
coefficient if you lose control, that's it.  Right now, the French are 
the only ones I know of who have LMFBRs.  If I lived in France, or even 
downwind, I'd move.

-- 
                                          Robert I. Eachus

"Quality is the Buddha. Quality is scientific reality. Quality is the 
goal of Art. It remains to work these concepts into a practical, 
down-to-earth context, and for this there is nothing more practical or 
down-to-earth than what I have been talking about all along...the repair 
of an old motorcycle."  -- from Zen and the Art of Motorcycle 
Maintenance by Robert Pirsig




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

* Re: stupid question
  2003-10-08 22:18 ` Robert I. Eachus
@ 2003-10-09 10:09   ` Steffen Huber
  2003-10-10 16:02     ` Robert I. Eachus
  0 siblings, 1 reply; 21+ messages in thread
From: Steffen Huber @ 2003-10-09 10:09 UTC (permalink / raw)


"Robert I. Eachus" wrote:
[snip]
> Liquid metal fast breeder reactors (LMFBRs) on the other hand may have
> response times to control inputs in seconds.  And with a positive void
> coefficient if you lose control, that's it.  Right now, the French are
> the only ones I know of who have LMFBRs.

Germany has one, too ("Schneller Brueter" in Kalkar), but it was only
built and ready-to-go - the real "go" never came and not a single
kWh was ever produced.

It is now a leisure park called "Kernwasser Wunderland" (something like
Nuclear-Water-Wonderland perhaps ;-)). Including free-climbing on
the cooling tower...

IIRC, the French also closed down their "Superphenix" LMFBR.

[snip]

Steffen

-- 
steffen.huber@gmx.de               steffen@huber-net.de
GCC for RISC OS  - http://www.arcsite.de/hp/gcc/
Private homepage - http://www.huber-net.de/



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

* Re: stupid question
  2003-10-09 10:09   ` Steffen Huber
@ 2003-10-10 16:02     ` Robert I. Eachus
  0 siblings, 0 replies; 21+ messages in thread
From: Robert I. Eachus @ 2003-10-10 16:02 UTC (permalink / raw)


Steffen Huber wrote:

> Germany has one, too ("Schneller Brueter" in Kalkar), but it was only
> built and ready-to-go - the real "go" never came and not a single
> kWh was ever produced.

If it is being used as a park, I hope that the sodium metal was never 
loaded.  The nuclear fuel, if never used is very inert, but sodium metal 
by the tonne is not something to have in a recreational setting.

Personally I don't want it anywhere other than in the middle of an 
extremely dry desert.  Sodium metal plus water either reacts quietly, 
burns, or explodes.  Get enough in one place and you get lots of 
explosions.  Oh, and of course, the lye (NaOH) produced dissolves skin.

-- 
                                         Robert I. Eachus

"Quality is the Buddha. Quality is scientific reality. Quality is the 
goal of Art. It remains to work these concepts into a practical, 
down-to-earth context, and for this there is nothing more practical or 
down-to-earth than what I have been talking about all along...the repair 
of an old motorcycle."  -- from Zen and the Art of Motorcycle 
Maintenance by Robert Pirsig




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

* Stupid question
@ 2007-04-12 20:05 Dmitry A. Kazakov
  2007-04-12 21:40 ` Adam Beneschan
  0 siblings, 1 reply; 21+ messages in thread
From: Dmitry A. Kazakov @ 2007-04-12 20:05 UTC (permalink / raw)


generic
package A is
   A1 : Integer;
end A;

generic
package A.B is
end A.B;

with A.B;
generic
   with package A_B is new A.B (<>);
package C is
   -- What is the name of A1 from A of A_B?
end C;

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

* Re: Stupid question
  2007-04-12 20:05 Stupid question Dmitry A. Kazakov
@ 2007-04-12 21:40 ` Adam Beneschan
  2007-04-12 22:02   ` Adam Beneschan
  0 siblings, 1 reply; 21+ messages in thread
From: Adam Beneschan @ 2007-04-12 21:40 UTC (permalink / raw)


On Apr 12, 1:05 pm, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> generic
> package A is
>    A1 : Integer;
> end A;
>
> generic
> package A.B is
> end A.B;
>
> with A.B;
> generic
>    with package A_B is new A.B (<>);
> package C is
>    -- What is the name of A1 from A of A_B?
> end C;

I am betting that if you try to compile just the code snippet you've
got, you will figure out your answer.

                                 -- Adam




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

* Re: Stupid question
  2007-04-12 21:40 ` Adam Beneschan
@ 2007-04-12 22:02   ` Adam Beneschan
  2007-04-13  8:20     ` Dmitry A. Kazakov
  0 siblings, 1 reply; 21+ messages in thread
From: Adam Beneschan @ 2007-04-12 22:02 UTC (permalink / raw)


I wrote:

> On Apr 12, 1:05 pm, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> wrote:
>
> > generic
> > package A is
> >    A1 : Integer;
> > end A;
>
> > generic
> > package A.B is
> > end A.B;
>
> > with A.B;
> > generic
> >    with package A_B is new A.B (<>);
> > package C is
> >    -- What is the name of A1 from A of A_B?
> > end C;
>
> I am betting that if you try to compile just the code snippet you've
> got, you will figure out your answer.

Sorry about that answer.  I made the rash assumption that you would be
using a compiler that works.  But apparently that's not necessarily
the case.

The version of GNAT I've got installed compiles the above code with no
errors, despite the fact that it's illegal.  I was assuming that you'd
get an error and the error would help you figure out what was wrong;
but I didn't figure on this happening.

The problem is that you cannot refer to A.B the way you did in your
"with package" declaration; you can only refer to A_Inst.B where
A_Inst is an instance of A (A_Inst could be another generic formal
package).

                                  -- Adam





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

* Re: Stupid question
  2007-04-12 22:02   ` Adam Beneschan
@ 2007-04-13  8:20     ` Dmitry A. Kazakov
  2007-04-13 13:53       ` Anh Vo
  2007-04-13 15:35       ` Adam Beneschan
  0 siblings, 2 replies; 21+ messages in thread
From: Dmitry A. Kazakov @ 2007-04-13  8:20 UTC (permalink / raw)


On 12 Apr 2007 15:02:18 -0700, Adam Beneschan wrote:

> I wrote:
> 
>> On Apr 12, 1:05 pm, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
>> wrote:
>>
>>> generic
>>> package A is
>>>    A1 : Integer;
>>> end A;
>>
>>> generic
>>> package A.B is
>>> end A.B;
>>
>>> with A.B;
>>> generic
>>>    with package A_B is new A.B (<>);
>>> package C is
>>>    -- What is the name of A1 from A of A_B?
>>> end C;
>>
>> I am betting that if you try to compile just the code snippet you've
>> got, you will figure out your answer.
> 
> Sorry about that answer.  I made the rash assumption that you would be
> using a compiler that works.  But apparently that's not necessarily
> the case.
> 
> The version of GNAT I've got installed compiles the above code with no
> errors, despite the fact that it's illegal.  I was assuming that you'd
> get an error and the error would help you figure out what was wrong;
> but I didn't figure on this happening.

[OK, GNAT has *lots* of problems with generics, it always had. I wonder
when AdaCore would finally decide to rewrite generics from scrap. But
that's aside.]

Are you saying that it is illegal to refer to generic children of generic
packages as generic packages? I don't see where 12.7 states it. 12.7(4):

"The generic_package_name shall denote a generic package (the template for
the formal package); the formal package is an instance of the template."

A.B is definitely a generic package to me.

> The problem is that you cannot refer to A.B the way you did in your
> "with package" declaration; you can only refer to A_Inst.B where
> A_Inst is an instance of A (A_Inst could be another generic formal
> package).

Well, you mean that dreadful:

with A.B;
generic
    with package A_Inst is new A (<>);
    with package A_B_Inst is new A_Inst.B (<>);
package C is
end C;

This what I am trying to avoid. It is awful (and GNAT has problems with the
constructs like that). 

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

* Re: Stupid question
  2007-04-13  8:20     ` Dmitry A. Kazakov
@ 2007-04-13 13:53       ` Anh Vo
  2007-04-13 15:35       ` Adam Beneschan
  1 sibling, 0 replies; 21+ messages in thread
From: Anh Vo @ 2007-04-13 13:53 UTC (permalink / raw)


On Apr 13, 1:20 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> On 12 Apr 2007 15:02:18 -0700, Adam Beneschan wrote:
>
> This what I am trying to avoid. It is awful (and GNAT has problems with the
> constructs like that).
>
GNAT-GPL-2007 is coming soon. I hope this problem and others will be
fixed once for all.

AV




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

* Re: Stupid question
  2007-04-13  8:20     ` Dmitry A. Kazakov
  2007-04-13 13:53       ` Anh Vo
@ 2007-04-13 15:35       ` Adam Beneschan
  2007-04-13 17:12         ` Dmitry A. Kazakov
  1 sibling, 1 reply; 21+ messages in thread
From: Adam Beneschan @ 2007-04-13 15:35 UTC (permalink / raw)


On Apr 13, 1:20 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:

> Are you saying that it is illegal to refer to generic children of generic
> packages as generic packages? I don't see where 12.7 states it. 12.7(4):
>
> "The generic_package_name shall denote a generic package (the template for
> the formal package); the formal package is an instance of the template."
>
> A.B is definitely a generic package to me.

Go back to 4.1.3.  When you're specifying an expanded name, you can't
use a prefix unless the prefix denotes a package, or an enclosing
named construct.  The prefix, here, "A", is not a package---it's a
generic.  And certainly you should know that you can't refer to things
inside a generic (except from inside that generic).  Suppose that,
instead of making B a child unit, you had nested it inside A:

   generic
   package A is
      A1 : Integer;
      generic
      package B is
      end B;
   end A;

Now, outside the declaration or body of A, you can't refer to "A.B"
any more than you can refer to "A.A1".  You need an instance to refer
to either one, i.e. A_Inst.B or A_Inst.A1.  Basically, you can't
directly refer to identifiers defined inside a generic---that much
should be well known.

Well, generic child packages really are just about the same as nested
generic packages.  Personally, I find it helpful to think of child
units (non-generic ones as well as generic ones) as being located
inside their parents, even though they're textually not located inside
anything.


> Well, you mean that dreadful:
>
> with A.B;
> generic
>     with package A_Inst is new A (<>);
>     with package A_B_Inst is new A_Inst.B (<>);
> package C is
> end C;
>
> This what I am trying to avoid. It is awful (and GNAT has problems with the
> constructs like that).

Yes, that's what I mean.  Sorry.  But it does solve your problem,
doesn't it?  Now you have no problem referring to A_Inst.A1, while the
syntax you seem to prefer (with just one generic formal parameter)
doesn't give you a way to do that.

                                 -- Adam





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

* Re: Stupid question
  2007-04-13 15:35       ` Adam Beneschan
@ 2007-04-13 17:12         ` Dmitry A. Kazakov
  2007-04-13 18:14           ` Adam Beneschan
  2007-04-13 19:01           ` Randy Brukardt
  0 siblings, 2 replies; 21+ messages in thread
From: Dmitry A. Kazakov @ 2007-04-13 17:12 UTC (permalink / raw)


On 13 Apr 2007 08:35:53 -0700, Adam Beneschan wrote:

> On Apr 13, 1:20 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> wrote:
> 
>> Are you saying that it is illegal to refer to generic children of generic
>> packages as generic packages? I don't see where 12.7 states it. 12.7(4):
>>
>> "The generic_package_name shall denote a generic package (the template for
>> the formal package); the formal package is an instance of the template."
>>
>> A.B is definitely a generic package to me.
> 
> Go back to 4.1.3.  When you're specifying an expanded name, you can't
> use a prefix unless the prefix denotes a package, or an enclosing
> named construct.

This does not outlaw A.B, it just cannot. A trivial counter example is:

with A.B;  -- This is 100% legal

With clause is defined in 10.1.2(4) as "with <name>". Here <name> is the
same as in 12.7. It refers to 4.1 and is resolved to <selected_component>.

Any language lawyers here?

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

* Re: Stupid question
  2007-04-13 17:12         ` Dmitry A. Kazakov
@ 2007-04-13 18:14           ` Adam Beneschan
  2007-04-13 18:50             ` Adam Beneschan
  2007-04-13 19:01           ` Randy Brukardt
  1 sibling, 1 reply; 21+ messages in thread
From: Adam Beneschan @ 2007-04-13 18:14 UTC (permalink / raw)


On Apr 13, 10:12 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> On 13 Apr 2007 08:35:53 -0700, Adam Beneschan wrote:
>
> > On Apr 13, 1:20 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> > wrote:
>
> >> Are you saying that it is illegal to refer to generic children of generic
> >> packages as generic packages? I don't see where 12.7 states it. 12.7(4):
>
> >> "The generic_package_name shall denote a generic package (the template for
> >> the formal package); the formal package is an instance of the template."
>
> >> A.B is definitely a generic package to me.
>
> > Go back to 4.1.3.  When you're specifying an expanded name, you can't
> > use a prefix unless the prefix denotes a package, or an enclosing
> > named construct.
>
> This does not outlaw A.B, it just cannot. A trivial counter example is:
>
> with A.B;  -- This is 100% legal
>
> With clause is defined in 10.1.2(4) as "with <name>". Here <name> is the
> same as in 12.7. It refers to 4.1 and is resolved to <selected_component>.
>
> Any language lawyers here?

10.1.6(2)

                                 -- Adam




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

* Re: Stupid question
  2007-04-13 18:14           ` Adam Beneschan
@ 2007-04-13 18:50             ` Adam Beneschan
  0 siblings, 0 replies; 21+ messages in thread
From: Adam Beneschan @ 2007-04-13 18:50 UTC (permalink / raw)


On Apr 13, 11:14 am, I wrote:

> On Apr 13, 10:12 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> wrote:
>
>
>
> > On 13 Apr 2007 08:35:53 -0700, Adam Beneschan wrote:
>
> > > On Apr 13, 1:20 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> > > wrote:
>
> > >> Are you saying that it is illegal to refer to generic children of generic
> > >> packages as generic packages? I don't see where 12.7 states it. 12.7(4):
>
> > >> "The generic_package_name shall denote a generic package (the template for
> > >> the formal package); the formal package is an instance of the template."
>
> > >> A.B is definitely a generic package to me.
>
> > > Go back to 4.1.3.  When you're specifying an expanded name, you can't
> > > use a prefix unless the prefix denotes a package, or an enclosing
> > > named construct.
>
> > This does not outlaw A.B, it just cannot. A trivial counter example is:
>
> > with A.B;  -- This is 100% legal
>
> > With clause is defined in 10.1.2(4) as "with <name>". Here <name> is the
> > same as in 12.7. It refers to 4.1 and is resolved to <selected_component>.
>
> > Any language lawyers here?
>
> 10.1.6(2)

OK, let me clarify that.  I checked the Ada 95 manual when I wrote
that response, but things have been rearranged a bit; the relevant
rule is now 10.1.6(6).  It's 10.1.6(2) in the Ada 95 manual.  If you
read AARM 10.1.6(6.a/2), that should clarify everything for you.

                                    -- Adam





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

* Re: Stupid question
  2007-04-13 17:12         ` Dmitry A. Kazakov
  2007-04-13 18:14           ` Adam Beneschan
@ 2007-04-13 19:01           ` Randy Brukardt
  2007-04-13 19:33             ` Markus E Leypold
  1 sibling, 1 reply; 21+ messages in thread
From: Randy Brukardt @ 2007-04-13 19:01 UTC (permalink / raw)


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:190oqb9t3eplx$.ffakhbeqreff$.dlg@40tude.net...
> On 13 Apr 2007 08:35:53 -0700, Adam Beneschan wrote:
...
> This does not outlaw A.B, it just cannot. A trivial counter example is:
>
> with A.B;  -- This is 100% legal
>
> With clause is defined in 10.1.2(4) as "with <name>". Here <name> is the
> same as in 12.7. It refers to 4.1 and is resolved to <selected_component>.
>
> Any language lawyers here?

Sorry, Adam is right. A generic package is not a package (that's a standing
ARG joke, not one of the RM's finest hours of terminology). Context clauses
have their own, unique visibility rules defined in 10.1.6; you can't use
them as a counterexample for anything. There is a very complex rule that
allows you to say A.B there, because it normally would not be.
Interestingly, the Ada 95 standard did not allow naming a grandchild that
way (that is, A.B.C), which demonstrates how complex it is.

                         Randy.







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

* Re: Stupid question
  2007-04-13 19:01           ` Randy Brukardt
@ 2007-04-13 19:33             ` Markus E Leypold
  2007-04-13 23:39               ` Randy Brukardt
  0 siblings, 1 reply; 21+ messages in thread
From: Markus E Leypold @ 2007-04-13 19:33 UTC (permalink / raw)



"Randy Brukardt" <randy@rrsoftware.com> writes:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:190oqb9t3eplx$.ffakhbeqreff$.dlg@40tude.net...
>> On 13 Apr 2007 08:35:53 -0700, Adam Beneschan wrote:
> ...
>> This does not outlaw A.B, it just cannot. A trivial counter example is:
>>
>> with A.B;  -- This is 100% legal
>>
>> With clause is defined in 10.1.2(4) as "with <name>". Here <name> is the
>> same as in 12.7. It refers to 4.1 and is resolved to <selected_component>.
>>
>> Any language lawyers here?
>
> Sorry, Adam is right. A generic package is not a package (that's a standing
> ARG joke, not one of the RM's finest hours of terminology). Context clauses
> have their own, unique visibility rules defined in 10.1.6; you can't use
> them as a counterexample for anything. There is a very complex rule that
> allows you to say A.B there, because it normally would not be.
> Interestingly, the Ada 95 standard did not allow naming a grandchild that
> way (that is, A.B.C), which demonstrates how complex it is.

So it is possible to say 'with A.B' in the context of a compilation
unit if A is "only" a generic (as opposed to an instance)? Even in Ada
95? Is there any example for that somewhere? 

Regards Markus






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

* Re: Stupid question
  2007-04-13 19:33             ` Markus E Leypold
@ 2007-04-13 23:39               ` Randy Brukardt
  2007-04-14  7:25                 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 21+ messages in thread
From: Randy Brukardt @ 2007-04-13 23:39 UTC (permalink / raw)


"Markus E Leypold"
<development-2006-8ecbb5cc8aREMOVETHIS@ANDTHATm-e-leypold.de> wrote in
message news:y7zm5chxxf.fsf@hod.lan.m-e-leypold.de...
>
> "Randy Brukardt" <randy@rrsoftware.com> writes:
>
> > "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> > news:190oqb9t3eplx$.ffakhbeqreff$.dlg@40tude.net...
> >> On 13 Apr 2007 08:35:53 -0700, Adam Beneschan wrote:
> > ...
> >> This does not outlaw A.B, it just cannot. A trivial counter example is:
> >>
> >> with A.B;  -- This is 100% legal
> >>
> >> With clause is defined in 10.1.2(4) as "with <name>". Here <name> is
the
> >> same as in 12.7. It refers to 4.1 and is resolved to
<selected_component>.
> >>
> >> Any language lawyers here?
> >
> > Sorry, Adam is right. A generic package is not a package (that's a
standing
> > ARG joke, not one of the RM's finest hours of terminology). Context
clauses
> > have their own, unique visibility rules defined in 10.1.6; you can't use
> > them as a counterexample for anything. There is a very complex rule that
> > allows you to say A.B there, because it normally would not be.
> > Interestingly, the Ada 95 standard did not allow naming a grandchild
that
> > way (that is, A.B.C), which demonstrates how complex it is.
>
> So it is possible to say 'with A.B' in the context of a compilation
> unit if A is "only" a generic (as opposed to an instance)? Even in Ada
> 95? Is there any example for that somewhere?

It's necessary to make children of generic packages work. Recall that a
child of a generic must be a generic.  The original question included an
example. (Personally, I think generic children aren't worth the trouble,
both in the language definition and in implementation. YMMV.)

                                Randy.





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

* Re: Stupid question
  2007-04-13 23:39               ` Randy Brukardt
@ 2007-04-14  7:25                 ` Dmitry A. Kazakov
  0 siblings, 0 replies; 21+ messages in thread
From: Dmitry A. Kazakov @ 2007-04-14  7:25 UTC (permalink / raw)


On Fri, 13 Apr 2007 18:39:52 -0500, Randy Brukardt wrote:

>> So it is possible to say 'with A.B' in the context of a compilation
>> unit if A is "only" a generic (as opposed to an instance)? Even in Ada
>> 95? Is there any example for that somewhere?
> 
> It's necessary to make children of generic packages work. Recall that a
> child of a generic must be a generic.  The original question included an
> example. (Personally, I think generic children aren't worth the trouble,
> both in the language definition and in implementation. YMMV.)

Ooch. Generics are painful enough. Without generic children they were just
unbearable. Passing 20+ generic instances through formal parameters is a
nightmare.

If Ada had constructs for composing and reusing declarative regions, one
could probably drop children, but it does not.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

end of thread, other threads:[~2007-04-14  7:25 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-12 20:05 Stupid question Dmitry A. Kazakov
2007-04-12 21:40 ` Adam Beneschan
2007-04-12 22:02   ` Adam Beneschan
2007-04-13  8:20     ` Dmitry A. Kazakov
2007-04-13 13:53       ` Anh Vo
2007-04-13 15:35       ` Adam Beneschan
2007-04-13 17:12         ` Dmitry A. Kazakov
2007-04-13 18:14           ` Adam Beneschan
2007-04-13 18:50             ` Adam Beneschan
2007-04-13 19:01           ` Randy Brukardt
2007-04-13 19:33             ` Markus E Leypold
2007-04-13 23:39               ` Randy Brukardt
2007-04-14  7:25                 ` Dmitry A. Kazakov
  -- strict thread matches above, loose matches on Subject: below --
2003-10-08  3:12 stupid question Shanon Fernald
2003-10-08  3:31 ` James Rogers
2003-10-08  4:34 ` Steve
2003-10-08 12:54   ` Marin David Condic
2003-10-08 13:01 ` Marin David Condic
2003-10-08 22:18 ` Robert I. Eachus
2003-10-09 10:09   ` Steffen Huber
2003-10-10 16:02     ` Robert I. Eachus

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