Modula2's godawful IO.

Vincent Hatem gak at mhuxm.UUCP
Tue Apr 12 01:42:43 AEST 1988


In article <535 at m10ux.UUCP>, rgr at m10ux.UUCP (Duke Robillard) writes:
> In article <764 at ndsuvax.UUCP> ncreed at ndsuvax.UUCP (Walter Reed) writes:
> >Here is an example of why these things bother me.
> >	IF (x = TRUE) THEN
> >		WriteString("Error #");
> >		WriteCard(e);
> >		WriteString(" in line #");
> >		WriteCard(l);
> >		WriteString(" detected.");
> 	:
>	:
> the solution.  Has anyone ever written some kind of front end for a 
> modula compiler to turn printf's into WriteSh*t's?  It doesn't seem 
> 	:
> |       Duke Robillard
> |       AT&T Bell Labs           m10ux!rgr at ihnp4.UUCP                 
> |       Murray Hill, NJ          {any biggy}!ihnp4!m10ux!rgr

Come on... give me a break. If you don't like the I/O subsystem, why don't
you re-write it??? A front-end translator in m4 is silly.

Besides, the whole idea of the WriteCard()-style I/O system is to remove the
20K overhead that printf() adds to programs. 95% of the functionality of 
printf() is never used, and you're just making your text segment larger.

I've worked on a replacement for printf() in Modula-2 which allowed most of
the basic formatting of numbers/strings which are used regularly. It also
allowed for OOP Object I/O function definitions, which allow you to tell it
to Write an Object with the functionality of a c++ construct such as this:
	cout << some_object_instance;

I'd post it, but it is based on a new I/O system (which I also worked on),
which is incompatible with Wirth's I/O system. (there used to be talk of 
making the library we wrote Freeware, but I haven't seen it yet...)



-- 
Vincent Hatem
AT&T International, International Systems Operations, UNIX Technical Support
                        Telefon: (201) 953-8030
		Please send all e-mail to: ihnp4!atti01!vch



More information about the Comp.lang.c mailing list