Re: Pascal program file parameter to Ada translation (Was: Re: Is GPC dead?)

Kevan Hashemi <[email protected]> Wed, 04 Jan 2017 17:26:44 -0500
Newsgroups gmane.comp.compilers.gpc
Organization Brandeis University
Message-ID <[email protected]>
Dear Leo,

Thanks for your answer. I like the "first" and "last" and "range" 
references for arrays.

> Yes, your "type Data ..." is the way to go. You can later declare arrays of
> type QData using
> 
>    foo : Qdata (1..37);
>    bah : Qdata (6..100);

My main concern is whether I can implement the following dynamic 
allocation of memory space for graphs, images, and matrices.

type
   graph_type(num_points:integer)=array [0..num_points-1] of real;
   graph_ptr=^graph_type;
var
   xg:graph_ptr;
   i:integer;
begin
   for i:=100 to 200 do begin
     new(xg,i);
     dispose(xg,i);
end;

Here we are creating arrays of integers of increasing size and disposing 
of them. I started moving to FPC a few years back, only to find that 
this dynamic functionality is not available. I'm reading about Ada 
"access" "get" and "put". The documentation hints at dynamic allocation, 
but I have not yet seen a piece of Ada code that absolutely clearly 
shows dynamic allocation.

Yours, Kevan

-- 
Kevan Hashemi, Electrical Engineer
Physics Department, Brandeis University
http://alignment.hep.brandeis.edu/

_______________________________________________
Gpc mailing list
[email protected]
https://www.g-n-u.de/mailman/listinfo/gpc