Next Previous Up Top Contents Index

15.2 An illustrative example of user defined streams

15.2.2 Recognizing the stream element type

We know that the stream will read from a file usingfile-stream functionality and that the stream element type will besimple-char. The following defines a method onstream-element-type to return the correct element type.

(defmethod stream-element-type ((stream unicode-ls-stream))
  'simple-char)

stream-element-type

Generic Function

stream-element-type stream

Package:common-lisp
The functionstream-element-type is implemented as a generic function. Depending on the stream, a method should be defined for this generic function that takes a stream as its argument and returns the element type of the stream.

LispWorks User Guide - 14 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker