Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!decwrl!pa.dec.com!src.dec.com!Dick Orgass From: orgass+@rchland.ibm.com (Dick Orgass) Newsgroups: comp.lang.modula3 Subject: Nit on Wr.i3 Message-ID: Date: 17 Apr 91 22:47:24 GMT Reply-To: "Dick Orgass" Lines: 25 To: m3 In one sense, this question is a real nit but there is a longer term performance question behind the nit. The procedures Wr.PutString and UnsafeWr.FastPutString are both declared so that the second parameter, the ARRAY OF CHAR to be written is a value parameter. This forces the compiler to write code to copy the array just to again copy it into the writer's buffer; the intermediate copy is then destroyed. By examining the code of the implementations of these procedures (in WrMove.m3), it's easy to see that the actual parameters are not modified. I propose that the declaration of these procedures be changed as follows: In Wr: PROCEDURE PutString(wr: T; READONLY a: ARRAY OF CHAR) RAISES {Failure, Alerted, Error}; In UnsafeWr: PROCEDURE FastPutString(wr: Wr.T; READONLY a: ARRAY OF CHAR) RAISES {Failure, Alerted, Error}; Dick