How do we write the command in Pidgin ALGOL?

699 views Asked by At

How can we write the command: printf("%d->%d", X, Y); in ALGOL where X and Y are the arguments of the recursive function.

Do we have to write something like: write "X -> Y"; ?

Or can we write : write "%d -> %d, X, Y";

1

There are 1 answers

0
Brian Tompsett - 汤莱恩 On

The question is probably more philosophical that you intended, as Algol (60) did not contain any input/output1, so there is no equivalent of printf.

Function calls in Algol (60) would look the same as in C: printf("%d->%d", X, Y);

In Algol-68, however, a standard input/output library of functions was defined - which it calls transput. As these are polymorphic the argument list would have been passed as an array of elements, thus:

print((whole(X),"->",whole(Y));

(but then you could have got that off Wikipedia anyway)

[1]:(Although most implementations added it as a library function!)