varargs in GPC_(re)

Tue, 11 Mar 1997 23:04:48 +0100 (MET)


> I thought that GPC did not support varargs.  In fact, I 
> was hoping that it would support the VAX Pascal syntax for
> doing so.  What is the status of variable arguments for GPC?

It does support `ellipsis' parameters to call functions with varargs
written in C.  We have not (yet!;) implemented a portable mechanism to
access them.

IMHO, it would be reasonable to implement the VAX Pascal syntax into GPC
rather than inventing a new method.  If you tell me about the VAX Pascal
syntax for accessing varargs, it will enable me to do this.

BTW, there is yet another Pascal standard definition, PXSC, which supports
overloading of procedures and functions.  In that dialect you can, for
instance, implement an exponential function for real, rational, complex
numbers, quaternions and matrices, and all of them are called `exp'.  This
covers many applications of varargs, is implemented in FPK Pascal and is
planned for GNU Pascal, too.

A way to pass a constant number of arguments of variable types is to use
UCSD (or Borland) Pascal's untyped `Var' parameters in combination with
Borland Pascal's `absolute' clauses:

    Procedure Foo ( Var Bar );

    Var
      BarChar: Char absolute bar;
      BarInt: Integer absolute bar;
      BarString: String ( 80 ) absolute bar;

    ...

However:  Please help me to with VAX Pascal vararg syntax!  I don't have
a VAX, and I don't have the money to buy one, so I need example programs
with descriptions what they are intended to do, etc. (you know).

Greetings,

    Peter

  Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer
peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201]
       maintainer GNU Pascal - http://home.pages.de/~gnu-pascal/ [970125]



Peter Gerwinski (peter@agnes.dida.physik.uni-essen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es