comp.lang.ada
 help / color / mirror / Atom feed
* COMPILATION-EXECUTION
@ 1998-12-15  0:00 Celinio
  1998-12-16  0:00 ` COMPILATION-EXECUTION Markus Rogawski
  1998-12-17  0:00 ` COMPILATION-EXECUTION Dale Stanbrough
  0 siblings, 2 replies; 3+ messages in thread
From: Celinio @ 1998-12-15  0:00 UTC (permalink / raw)


subtype M is Character range 'A' .. 'Z';
C: array (M) of Natural;
I: integer : =1;
**************************************
What can be inferred from the following calls  (compilation and then
execution ) ?
C('i'):=1;

C('I'):=I;

C('I'):='I';

C(I):=I;

C('I'):=0;











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

* Re: COMPILATION-EXECUTION
  1998-12-15  0:00 COMPILATION-EXECUTION Celinio
@ 1998-12-16  0:00 ` Markus Rogawski
  1998-12-17  0:00 ` COMPILATION-EXECUTION Dale Stanbrough
  1 sibling, 0 replies; 3+ messages in thread
From: Markus Rogawski @ 1998-12-16  0:00 UTC (permalink / raw)


Oh, very nice! An Christmas riddle!

Celinio schrieb:

> subtype M is Character range 'A' .. 'Z';
> C: array (M) of Natural;
> I: integer : =1;
> **************************************
> What can be inferred from the following calls  (compilation and then
> execution ) ?
> C('i'):=1;
>

compiler: error

> C('I'):=I;
>

natural is a subtype of integer. As long the value of I is an natural it
should work. Otherwise it should throw an exception: Constained_error.

> C('I'):='I';
>

Compiler: error

> C(I):=I;
>

compiler: error

> C('I'):=0;

Looks ok.Hello Celinio!

Why not try it on your compiler?



Tsch"o

Markus





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

* Re: COMPILATION-EXECUTION
  1998-12-15  0:00 COMPILATION-EXECUTION Celinio
  1998-12-16  0:00 ` COMPILATION-EXECUTION Markus Rogawski
@ 1998-12-17  0:00 ` Dale Stanbrough
  1 sibling, 0 replies; 3+ messages in thread
From: Dale Stanbrough @ 1998-12-17  0:00 UTC (permalink / raw)


Celinio  wrote:

 subtype M is Character range 'A' .. 'Z';
 C: array (M) of Natural;
 I: integer : =1;
 **************************************
 What can be inferred from the following calls  (compilation and then
 execution ) ?

   [stuff deleted]

Personally I would infer that you are trying to get your homework done
by someone else.

Dale




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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-15  0:00 COMPILATION-EXECUTION Celinio
1998-12-16  0:00 ` COMPILATION-EXECUTION Markus Rogawski
1998-12-17  0:00 ` COMPILATION-EXECUTION Dale Stanbrough

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