From jmoringe at techfak.uni-bielefeld.de Sun Oct 5 11:17:51 2014 From: jmoringe at techfak.uni-bielefeld.de (Jan Moringen) Date: Sun, 05 Oct 2014 13:17:51 +0200 Subject: [Alexandria-devel] add COPY-STREAM-CONTENT-INTO-{STRING, BYTE-VECTOR}? Message-ID: <1412507871.1297.15.camel@techfak.uni-bielefeld.de> Hi, in my experience, READ-FILE-INTO-{STRING,BYTE-VECTOR} are very handy. However, maybe half of the time I already receive an open stream and need something like R-F-I-{S,B-V} but for streams. I already submitted the attached patch in mid 2012. Nikodemus didn't want to introduce new functions at that time. Please consider it again. The patch adds the functions COPY-STREAM-CONTENT-INTO-{STRING,BYTE-VECTOR} which implement this feature. Despite the new toplevel functions, little new code is introduced since R-F-I-{S,B-V} can be implemented in terms of the new functions. Thanks in advance and kind regards, Jan -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-add-COPY-STREAM-CONTENT-INTO-STRING-BYTE-VECTOR.patch Type: text/x-patch Size: 4249 bytes Desc: not available URL: From jmoringe at techfak.uni-bielefeld.de Sun Oct 5 12:19:26 2014 From: jmoringe at techfak.uni-bielefeld.de (Jan Moringen) Date: Sun, 05 Oct 2014 14:19:26 +0200 Subject: [Alexandria-devel] add COPY-STREAM-CONTENT-INTO-{STRING, BYTE-VECTOR}? In-Reply-To: <1412507871.1297.15.camel@techfak.uni-bielefeld.de> References: <1412507871.1297.15.camel@techfak.uni-bielefeld.de> Message-ID: <1412511566.1297.17.camel@techfak.uni-bielefeld.de> On Sun, 2014-10-05 at 13:17 +0200, Jan Moringen wrote: > The patch adds the functions > COPY-STREAM-CONTENT-INTO-{STRING,BYTE-VECTOR} which implement this > feature. Despite the new toplevel functions, little new code is > introduced since R-F-I-{S,B-V} can be implemented in terms of the new > functions. I missed that COPY-STREAM-CONTENT-INTO-BYTE-VECTOR called FILE-LENGTH, pretty much defeating its purpose. Attached is an improved version that is as efficient as before when the stream length is known and geometrically grows the output buffer otherwise. Sorry and kind regards, Jan -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-add-COPY-STREAM-CONTENT-INTO-STRING-BYTE-VECTOR.patch Type: text/x-patch Size: 4868 bytes Desc: not available URL: