[fpc-pascal]WoW

Gabor DEAK JAHN djg at tramontana.co.hu
Mon Aug 27 05:37:47 CEST 2001


At 8/26/01 03:49 PM, you wrote:

Ralf,

 > implementation to use such constructs. But to my knowledge, there was never
 > an official "standard" for this, though i don't know the ANSI specs for
 > Pascal and Extended Pascal to the full extent...

Extended Pascal (ISO/IEC 10206) -- available from
http://www.pascal-central.com/standards.html, -- defines them completely.
Basically, there are two building blocks, an interface and an
implementation, in the format:

-----------------------------------------------
module Name interface;
export
   Name = (x, y, z, a, b, c);
import
   i only (frange >= range);
   procedure SetState (NewState : LineState);
const
   x1 = 2;
type
   newtype = integer;
var
   variable : integer;

[procedures and functions]

end.
-----------------------------------------------

Apart from the slightly different wording at the beginning, the main
difference compared to the Borland way are the export and import parts,
which list all identifiers (variables, types, constants, procedure and
function names) that are exported from or imported into the module. In both
directions you can restrict the range and rename any identifier (for
instance to avoid a name conflict with an identifier used inside the module).

The implementation is similar in format (with the obvious difference of
'implementation' in the first row) but might have two other sections at the
end which deserve a closer look--both initialization and finalization code:

-----------------------------------------------
module Name implementation;
export
   ...
import
   ...
const
   ...
type
   ...
var
   ...

to begin do
   begin
   ...
   end;

to end do
   begin
   ...
   end;

end.
-----------------------------------------------

As for me, I consider Extended + OOP Pascal to be much better than any
Borland or other attempt so far. Quite a pity we still don't have a good,
fully compliant compiler...


Bye,
    Gábor

-------------------------------------------------------------------
Gabor DEAK JAHN -- Budapest, Hungary.
E-mail: djg at tramontana.co.hu





More information about the fpc-pascal mailing list