Re: Untyped variables of a function

"F. W." <[email protected]> Thu, 2 Sep 2021 08:05:04 +0200
Newsgroups alt.comp.lang.pascal
Organization Aioe.org NNTP Server
Message-ID <[email protected]>
Am 02.09.2021 um 00:53 schrieb Shadow:

>> Pascal has strong types. Is it anyhow possible to define a 
>> parameter of a function or procedure that allows passing variables 
>> of any type?

> I discovered that to get help here you have to describe exactly what 
> you are trying to do. No, the group is not dead. What sort of 
> function would have to accept any kind of variable? []'s

I wanted to imitate the printf-function of c in Pascal.

void printf (char *format, ...)

That was one of the advantages of Pascal against Modula-2. There was no
flexible WRITE/WRITELN-Procedure in M2.

VAR a: INTEGER; b: CHAR; c: STRING;

Modula-2:

IO.WrStr ('Hello');
IO.WrInt (a);
IO.WrStr (b);
IO.WrStr (c);

Pascal:

WRITELN ('Hello', a, b, c);

FW