Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-11

conformant arrays and Free Pascal

6 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bruce Bauman

I am trying to convert a huge amount of code written in MetaWare Professional Pascal to Free Pascal. Unfortunately, the MetaWare code makes fairly extensive use of Pascal conformant arrays.

Free Pascal's open arrays are similar, but modifying all of the uses of conformant arrays would be a fairly big job.

Any advice for us?

-- Bruce
CONFIDENTIALITY NOTICE: This e-mail is confidential and intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please delete it from your computer and contact the sender.

Reply by email

Michael Van Canneyt
to Bruce Bauman
Bruce Bauman wrote 6 lines
I am trying to convert a huge amount of code written in MetaWare Professional Pascal to Free Pascal. Unfortunately, the MetaWare code makes fairly extensive use of Pascal conformant arrays. Free Pascal's open arrays are similar, but modifying all of the uses of conformant arrays would be a fairly big job.

Can you give us some more info on conformant arrays ? It's the first time I heard of such a construct.

Michael.

Reply by email

leledumbo
to Michael Van Canneyt: Can you give us some more info on conformant arrays ? It's the first time I heard of such…
Can you give us some more info on conformant arrays ? It's the first time I heard of such a construct.

AFAIK it's stated in ISO 7185 document. Haven't you read it?

A conformant array is a formal parameter array whose bounds will conform to those of an actual parameter array. (The element types of both must be the same.)

An
http://www.mirrorservice.org/sites/www.gnu-pascal.de/demos/conformantdemo.pas Example from GPC site.

View this message in context: http://old.nabble.com/conformant-arrays-and-Free-Pascal-tp26221055p26229528.html Sent from the Free Pascal - General mailing list .

Reply by email

Mehmet Erol Sanliturk
to Michael Van Canneyt: Hmmm. Does not sound like something easily supported :( Michael.
Michael Van Canneyt wrote 17 lines
On Fri, 6 Nov 2009, Jonas Maebe wrote: > > On 06 Nov 2009, at 09:03, Michael Van Canneyt wrote: > >> Can you give us some more info on conformant arrays ? It's the first >> time I heard of such a construct. > > http://docs.hp.com/cgi-bin/doc3k/B3150290023.10194/53 Hmmm. Does not sound like something easily supported :( Michael.

In the book

A Model Implementation of Standard Pascal

by
Jim Welsh and
Atholl Hay

PRENTICE/HALL INTERNATIONAL
ISBN : 0-13-586454-2
1986

the Conformant Arrays are implemented .
( page 92 : 9.10 Conformant array handling )

( Standard Pascal means a Pascal defined by Standards BS 6192 and ISO 7185 . )

In its Foreword it is written

´Firstly it places in the public domain a complete implementation of the International Standard for the PASCAL programming language . ´ ( p. vii )

I think , in a Pascal compiler
ability to define an array like the following

Procedure X
       (
       m : Integer ;
       n : Integer ;
       p : Integer ;
       q : Integer ;
   Var a : Array [ m .. n , p .. q ] of Real ;
       ...
       ) ;

will make it very usable in scientific computations like Fortran having run time Dimension statement .

Here , the most important part is to use m , n , p , q as VARIABLES taking values at run time .

At present , when m , n , p , q are constants , the following statement is compiled :

Const  m = 1 ;
Const  n = 20 ;
Const  p = 0  ;
Const  q = 45 ;

Procedure X
(

   Var a : Array [ m .. n , p .. q ] of Real ;
       ...
       ) ;

A similar part will be inserted into compiled code to be used in run time .

Thank you very much

Mehmet Erol Sanliturk

Reply by email