Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!ubc.CSNET!manis From: manis@UBC.CSNET (Vincent Manis) Newsgroups: net.lang.mod2 Subject: Variadic procedures and I/O Message-ID: <978:manis@cs.ubc.cdn> Date: Tue, 11-Mar-86 14:32:09 EST Article-I.D.: cs.978:manis Posted: Tue Mar 11 14:32:09 1986 Date-Received: Fri, 14-Mar-86 03:45:41 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 17 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.