FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.0
New since 8.0 release.

make-function-input-stream

Arguments: function &rest args

This operator was added in an update released around February 3, 2006. You must have that update to use this operator. See sys:update-allegro for information on updating Allegro CL.

make-function-input-stream creates and returns an input stream that is populated by function. function is invoked in a new Lisp process with one or more arguments (function will be passed the same number of arguments as make-function-input-stream was passed). The first argument is an output stream to which function should write. The data written by function will be available for reading on the input stream which make-function-input-stream returns. The remaining arguments passed to function are the remaining arguments that were passed to make-function-input-stream. When function terminates (either normally or abnormally), the output stream is closed.

See also with-function-input-stream.

Example

(defun filler (writeto count)
  (dotimes (n count)
     (write-byte n writeto))
  (close writeto))

(setf instream (make-function-input-stream #'filler 5))

(read-byte instream)
RETURNS 0
(read-byte instream)
RETURNS 1

Copyright (c) 1998-2008, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 8.0. This page is new in the 8.0 release.
Created 2007.4.30.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.0
New since 8.0 release.