fix atom_term builtin not to require previous loading of charsio.

This commit is contained in:
Vitor Santos Costa
2011-01-20 11:51:46 -06:00
parent d593f99c13
commit d52d05a626
2 changed files with 17 additions and 13 deletions

View File

@@ -49,13 +49,6 @@ format_to_chars(Form, Args, OUT, L0) :-
write_to_chars(Term, OUT) :-
write_to_chars(Term, [], OUT).
write_to_chars(Term, L0, OUT) :-
open_mem_write_stream(Stream),
write(Stream, Term),
peek_mem_write_stream(Stream, L0, O),
close(Stream),
O = OUT.
atom_to_chars(Atom, OUT) :-
atom_to_chars(Atom, [], OUT).
@@ -88,12 +81,6 @@ number_to_chars(Number, L0, OUT) :-
number_to_chars(Number, L0, OUT) :-
throw(error(type_error(number,Number),number_to_chars(Number, L0, OUT))).
read_from_chars(Chars, Term) :-
open_mem_read_stream(Chars, Stream),
read(Stream, T),
close(Stream),
T = Term.
open_chars_stream(Chars, Stream) :-
open_mem_read_stream(Chars, Stream).