comp.lang.ada
 help / color / mirror / Atom feed
* Re: ADA 95 Questions.
       [not found] <35890E1B.2A19914F@tech.swh.lv>
@ 1998-06-18  0:00 ` Mats Weber
  1998-06-19  0:00   ` falis
  0 siblings, 1 reply; 3+ messages in thread
From: Mats Weber @ 1998-06-18  0:00 UTC (permalink / raw)



Maxim Senin wrote:
> 
> Hi all!
> 
> I have some ADA questions:
> 
>    * Is ADA garbage collector?

Ada allows a garbage collector, but does not require it. I think there is
currently no Ada implementation that provides garbage collection. Note that
controlled types eliminate much of the need for GC.

>    * Can I do something like in C++?:
>      int[] array = new int [100];

type Int_Array is array (Positive range <>) of Int;
type Int_Array_Access is access Int_Array;

X : Int_Array_Access := new Int_Array(1 .. 100);

>      How can I dinamically allocate array?

see above.

>      How to copy array elements? I mean, can I copy part of array as
>      it is fo strings in this manner:
>      s1 : String := "Hello";
>      s2 : String := "World!";
>      begin
>          s1 (1..4) := s2 (2..5); -- will result s1 = "orllo"
>      end

The code is correct, but the reesult will be s1 = "orldo".

>      or like Java's System.arraycopy() routine?
>    * What's the difference between A, A'Class and A'Access? (Seems
>      A'Access is similar to C's &A)?

A'Class is not an access type. It is an indefinite type that can hold a value
of A or any of A's subclasses (i.e. any type derived directly of indirectly
from A). A'Access denotes a pointer to the object A. A'Access does not mean
anything when A is a type. I would recommend reading about this in a book (not
the RM, it's too hard to read when leaning the language). 

>    * What's the difference between following procedure defs:
>      procedure p (a : C);

the parameter must be of type C.

>      procedure p (a : C'Class);

the parameter must be C or any type derived from C (if C is tagged).

>      procedure p (a : C'Access);

does not compile.

>      procedure p (a : access C);

the parameter must be a pointer to an object of type C.

>      procedure p (a : in out C); ?

the parameter can be both read and written, as opposed to the other cases
above (except access).

>    * What means procedure/function parameter without "in/out"
>      specifier (e.g. procedure p (a : Integer; b : in Boolean; c : out
>      Float; d : in out Double))?

if there is no mode specified, then the mode is in.




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

* Re: ADA 95 Questions.
  1998-06-18  0:00 ` ADA 95 Questions Mats Weber
@ 1998-06-19  0:00   ` falis
  1998-06-21  0:00     ` Robert Dewar
  0 siblings, 1 reply; 3+ messages in thread
From: falis @ 1998-06-19  0:00 UTC (permalink / raw)



> Maxim Senin wrote:
> > 
> > Hi all!
> > 
> > I have some ADA questions:
> > 
> >    * Is ADA garbage collector?
> 
> Ada allows a garbage collector, but does not require it. I think there is
> currently no Ada implementation that provides garbage collection. Note that
> controlled types eliminate much of the need for GC.

Great Circle from Geodesic Systems can be linked with ObjectAda executables (Windows or UNIX) to provide garbage collection.  AppletMagic and ObjectAda 
get GC for free in the versions targeting the JVM.


- Ed Falis
Aonix




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

* Re: ADA 95 Questions.
  1998-06-19  0:00   ` falis
@ 1998-06-21  0:00     ` Robert Dewar
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Dewar @ 1998-06-21  0:00 UTC (permalink / raw)



Ed said

<<Great Circle from Geodesic Systems can be linked with ObjectAda executables (Win
dows or UNIX) to provide garbage collection.  AppletMagic and ObjectAda
get GC for free in the versions targeting the JVM.
>>

This is of course conservative garbage collection. Go to dejanews to see
lots of discussion on this point.





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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <35890E1B.2A19914F@tech.swh.lv>
1998-06-18  0:00 ` ADA 95 Questions Mats Weber
1998-06-19  0:00   ` falis
1998-06-21  0:00     ` Robert Dewar

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