Xref: utzoo comp.lang.modula2:793 comp.lang.misc:1457 comp.lang.c:9433 comp.lang.pascal:813 Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!rutgers!mtunx!whuts!homxb!mhuxt!m10ux!rgr From: rgr@m10ux.UUCP (Duke Robillard) Newsgroups: comp.lang.modula2,comp.lang.misc,comp.lang.c,comp.lang.pascal Subject: Re: Modula2's godawful IO. Message-ID: <553@m10ux.UUCP> Date: 16 Apr 88 22:33:19 GMT References: <764@ndsuvax.UUCP> <535@m10ux.UUCP> <96@lzaz.ATT.COM> <547@m10ux.UUCP> <6366@watdragon.waterloo.edu> Reply-To: rgr@m10ux.UUCP (Duke Robillard) Organization: AT&T Bell Labs, Murray Hill Lines: 29 In article <6366@watdragon.waterloo.edu] gjditchfield@violet.waterloo.edu (Glen Ditchfield) writes: ]In article <547@m10ux.UUCP] rgr@m10ux.UUCP (Duke Robillard) writes: ]]In article <96@lzaz.ATT.COM] bds@lzaz.ATT.COM (BRUCE SZABLAK) writes: ]]] cout << god_awful_structure_instance; ]]Yeah, but that doesn't help me print out an error message, two strings, ]]and an integer return code. I don't want to have to write a method ]]for every print.... ] ]Neither would I. Fortunately for us, the i/o operators can be chained. ] cout << "Error: file " << fname << ", line " << lnum ] << error_msg << "\n"; This is cool. The syntax is a little bulky (how un-C-like) but overall it looks good. ]I think this is a big improvement over calls to overloaded "Print" ]procedures. However, I don't really see that this is any different than overloading a print procedure. all you're doing is overloading "<<" (i.e. making it handle strings, integers, reals, whatever), right? -- + | Duke Robillard | AT&T Bell Labs m10ux!rgr@ihnp4.UUCP | Murray Hill, NJ {any biggy}!ihnp4!m10ux!rgr