Plaster
New
List
Login
text
default
anonymous
2019.12.15 19:24:07
;; Wow, the following function demonstrates use of the run-time ;; property of keyword arguments! (defun make-pipe-streams (&key (element-type '(unsigned-byte 8))) "Return two streams, one for reading and the other for writing. When elements are written to the write stream, they will be able to be read by the read stream. When the write stream is closed, the read stream will reach the end-of-file." (multiple-value-bind (read write) (pipe) (flet ((stream-of-type (type fd) (make-fd-stream fd :element-type element-type :buffering :none :auto-close t type t))) (values (stream-of-type :input read) (stream-of-type :output write)))))
Raw
Annotate
Repaste
Edit