[net.lang.mod2] Variadic procedures and I/O

manis@UBC.CSNET (Vincent Manis) (03/11/86)

I've always been a supporter of the C 'printf' style of I/O routines (even
back when it was 'writef' in BCPL). However, I must agree with Rob Nagler
that the merits of printf don't really justify extending the language.

There's a good pedagogical reason (for intermediate students, at least) not
to have variadic I/O procedures anyway. We teach students to modularise code,
and one of the best places for modularity is in I/O. A user interaction, or
file I/O, should be done by a procedure call anyway (so as to make the
program portable and yet support environments such as the Macintosh Toolbox
or GEM), rather than a chain of Write calls. The Modula-2 style really
forces students to write their own special-case I/O procedures. Salvation
through suffering, but it does seem to work, with my students at least.
For rank beginners, this argument doesn't work. I would therefore support
the addition of two basic procedures READ and WRITE, which are variadic, and
translate into a series of procedure calls (with the same translation
process as that for NEW into ALLOCATE). However, my support is still only
lukewarm.