mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-10 11:12:58 -08:00
When a routine expects an input/output stream and does not get it, it should be a type-error
This commit is contained in:
parent
3a108005c9
commit
6b04f32bb3
1 changed files with 10 additions and 2 deletions
12
src/c/file.d
12
src/c/file.d
|
|
@ -244,13 +244,21 @@ static void wrong_file_handler(cl_object strm) /*__attribute__((noreturn))*/;
|
|||
static void
|
||||
not_an_input_stream(cl_object strm)
|
||||
{
|
||||
FEerror("Cannot read the stream ~S.", 1, strm);
|
||||
cl_error(9, @'simple-type-error', @':format-control',
|
||||
make_constant_string("~A is not an input stream"),
|
||||
@':format-arguments', cl_list(1, strm),
|
||||
@':expected-type', cl_list(2, @'satisfies', @'input-stream-p'),
|
||||
@':datum', cl_stream_element_type(strm));
|
||||
}
|
||||
|
||||
static void
|
||||
not_an_output_stream(cl_object strm)
|
||||
{
|
||||
FEerror("Cannot write to the stream ~S.", 1, strm);
|
||||
cl_error(9, @'simple-type-error', @':format-control',
|
||||
make_constant_string("~A is not an output stream"),
|
||||
@':format-arguments', cl_list(1, strm),
|
||||
@':expected-type', cl_list(2, @'satisfies', @'output-stream-p'),
|
||||
@':datum', cl_stream_element_type(strm));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue