ExLisp.Stream (exlisp v0.1.2)

Copy Markdown

ANSI Common Lisp Streams implementation for ExLisp. Supports:

  • streamp, open-stream-p, input-stream-p, output-stream-p, interactive-stream-p, stream-element-type, close
  • make-string-input-stream, make-string-output-stream, get-output-stream-string
  • make-broadcast-stream, make-concatenated-stream, make-two-way-stream, make-echo-stream, make-synonym-stream
  • broadcast-stream-streams, concatenated-stream-streams, two-way-stream-input-stream, two-way-stream-output-stream, echo-stream-input-stream, echo-stream-output-stream, synonym-stream-symbol
  • open, file-length, file-position
  • read-char, unread-char, peek-char, read-line, read-sequence
  • write-char, write-string, write-line, write-sequence
  • terpri, fresh_line, finish-output, force-output, clear-output, listen, clear-input

Summary

Functions

Opens a file stream. filespec: pathname or string options: :direction, :element_type, :if_exists, :if_does_not_exist, :external_format

Reads a single character (as an integer character code) from stream.

Reads a line from stream. Returns multiple values: (values line missing_newline_p).

Reads elements into sequence. Returns the end index.

Pushes character back to input stream.

Types

t()

@type t() :: %ExLisp.Stream{
  device: any(),
  element_type: any(),
  extra: map(),
  id: any(),
  mode: :input | :output | :io,
  open: boolean(),
  type:
    :file
    | :string_input
    | :string_output
    | :broadcast
    | :concatenated
    | :two_way
    | :echo
    | :synonym
    | :standard,
  unread_chars: [integer()]
}

Functions

broadcast_stream_streams(arg1)

clear_input(stream \\ nil)

clear_output(stream \\ nil)

close(stream, opts \\ [])

concatenated_stream_streams(arg1)

echo_stream_input_stream(arg1)

echo_stream_output_stream(arg1)

file_length(pid)

file_position(stream, pos_spec \\ nil)

finish_output(stream \\ nil)

force_output(stream \\ nil)

fresh_line(stream \\ nil)

get_output_stream_string(pid)

input_stream_p(pid)

interactive_stream_p(arg1)

listen(stream \\ nil)

make_broadcast_stream(streams \\ [])

make_concatenated_stream(streams \\ [])

make_echo_stream(input_stream, output_stream)

make_string_input_stream(string, arg2 \\ 0, arg3 \\ nil)

make_string_output_stream(opts \\ [])

make_synonym_stream(symbol)

make_two_way_stream(input_stream, output_stream)

open(filespec, opts \\ [])

Opens a file stream. filespec: pathname or string options: :direction, :element_type, :if_exists, :if_does_not_exist, :external_format

open_stream_p(pid)

output_stream_p(pid)

peek_char(peek_type \\ nil, stream \\ nil, eof_error_p \\ :t, eof_value \\ nil, rec \\ nil)

Peeks at next character without consuming it.

read_char(stream \\ nil, eof_error_p \\ :t, eof_value \\ nil, recursive_p \\ nil)

Reads a single character (as an integer character code) from stream.

read_line(stream \\ nil, eof_error_p \\ :t, eof_value \\ nil, rec \\ nil)

Reads a line from stream.

read_line_mv(stream \\ nil, eof_error_p \\ :t, eof_value \\ nil, rec \\ nil)

Reads a line from stream. Returns multiple values: (values line missing_newline_p).

read_sequence(sequence, stream, opts \\ [])

Reads elements into sequence. Returns the end index.

stream_element_type(arg1)

streamp(pid)

synonym_stream_symbol(arg1)

terpri(stream \\ nil)

two_way_stream_input_stream(arg1)

two_way_stream_output_stream(arg1)

unread_char(char, stream \\ nil)

Pushes character back to input stream.

write_char(char, stream \\ nil)

write_line(string, stream \\ nil, opts \\ [])

write_sequence(sequence, stream, opts \\ [])

write_string(string, stream \\ nil, opts \\ [])