Document UIOP:SLURP-INPUT-STREAM

Bug #1208208 reported by Robert P. Goldman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ASDF
Fix Released
Undecided
Robert P. Goldman

Bug Description

A programmer cannot completely understand how to use UIOP:RUN-PROGRAM without understanding the generic function SLURP-INPUT-STREAM. The documentation of the former (see docstring) refers to the latter, but the latter has no documentation:

"OUTPUT should be a value that is a suitable first argument to
SLURP-INPUT-STREAM. In this case, RUN-PROGRAM will create a temporary stream
for the program output. The program output, in that stream, will be processed
by SLURP-INPUT-STREAM, using OUTPUT as the first argument.
RUN-PROGRAM will return whatever SLURP-INPUT-STREAM returns. E.g., using
:OUTPUT :STRING will have it return the entire output stream as a string. Use
ELEMENT-TYPE and EXTERNAL-FORMAT for the stream passed to the OUTPUT processor."

If someone can supply me a docstring for SLURP-INPUT-STREAM, or even a simple sentence or two about the protocol, I (rpg) will fix it up and push it into ASDF.

It would also be helpful to explain what happens if OUTPUT is non-NIL, but a non-zero exit status results from the program invocation.

Thanks!

Revision history for this message
Robert P. Goldman (rpgoldman) wrote :

Whoops -- that remark about the error status is off-base -- it's all documented there.

Revision history for this message
Faré (fahree) wrote :

SLURP-INPUT-STREAM is a generic function with two positional arguments PROCESSOR and INPUT-STREAM and keyword arguments, that consumes (slurps) the contents of the INPUT-STREAM and processes them according to a method specified by PROCESSOR.

Notable methods include the following:
* if PROCESSOR is a function, it is called with the INPUT-STREAM as its argument
* if PROCESSOR is a list, its first element is applied to a cons of the INPUT-STREAM and the rest of the list.
* if PROCESSOR is an output-stream, the contents of INPUT-STREAM is copied to the output-stream, as per copy-stream-to-stream, with appropriate keyword arguments.
* if PROCESSOR is the symbol CL:STRING or the keyword :STRING, then the contents of INPUT-STREAM are returned as a string, as per slurp-stream-string.
...

Revision history for this message
Faré (fahree) wrote :

Users may define more methods on this generic function.

Changed in asdf:
assignee: Faré (fahree) → Robert P. Goldman (rpgoldman)
Revision history for this message
Robert P. Goldman (rpgoldman) wrote :

OK, now it's my job to get this formatted and pushed.

Revision history for this message
Robert P. Goldman (rpgoldman) wrote :

Fix in 3.0.2.3

Changed in asdf:
status: New → Fix Committed
Changed in asdf:
milestone: none → 3.0.3
Changed in asdf:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.