File tree Expand file tree Collapse file tree 2 files changed +8
-27
lines changed Expand file tree Collapse file tree 2 files changed +8
-27
lines changed Original file line number Diff line number Diff line change 15
15
read_term_from_chars /3,
16
16
write_term_to_chars /3,
17
17
chars_base64 /3,
18
- char_stream /1,
18
+ chars_stream /1,
19
19
chars_to_stream /2,
20
- chars_to_stream /3,
21
- put_chars /2]).
20
+ chars_to_stream /3]).
22
21
23
22
:- use_module (library(dcgs )).
24
23
:- use_module (library(iso_ext )).
398
397
)
399
398
).
400
399
401
- %% put_chars(+Stream, +Chars). %
402
- %
403
- % Writes a list of characters to a stream.
404
- %
405
- % `Stream` is the output stream, and `Chars` is the list of characters to write.
406
- %
407
- % Example:
408
- %
409
- % ```
410
- % ?- put_chars(current_output, "hello").
411
- % hello
412
- % true.
413
- % ```
414
-
415
- put_chars (Stream , Chars ) :-
416
- must_be(chars , Chars ),
417
- maplist(put_char(Stream ), Chars ).
418
-
419
- %% char_stream(-Stream)
400
+ %% chars_stream(-Stream)
420
401
% Stream is a character stream.
421
402
422
- char_stream (Stream ) :-
403
+ chars_stream (Stream ) :-
423
404
'$memory_stream' (Stream ).
424
405
425
406
%% chars_to_stream(+Chars, -Stream) :-
445
426
chars_to_stream(Chars , Stream , _ ) :-
446
427
must_be(chars , Chars ),
447
428
'$memory_stream' (Stream ),
448
- put_chars( Stream , Chars ).
429
+ maplist(put_char( Stream ) , Chars ).
Original file line number Diff line number Diff line change 8
8
9
9
10
10
test ("can create string char stream" ,
11
- ( char_stream (Stream ),
11
+ ( chars_stream (Stream ),
12
12
put_char(Stream , a ),
13
13
get_char(Stream , C ),
14
14
C =a
17
17
18
18
test ("can spell simple word with char stream" ,
19
19
(
20
- char_stream (Stream ),
20
+ chars_stream (Stream ),
21
21
put_char(Stream , c ),
22
22
put_char(Stream , a ),
23
23
put_char(Stream , t ),
27
27
28
28
test ("can read from and write to char stream" ,
29
29
(
30
- char_stream (Stream ),
30
+ chars_stream (Stream ),
31
31
put_char(Stream , c ),
32
32
put_char(Stream , a ),
33
33
get_char(Stream , _C ),
You can’t perform that action at this time.
0 commit comments