|
195 | 195 | ; type_error(in_character, C, get_single_char/1)
|
196 | 196 | ).
|
197 | 197 |
|
198 |
| -%% read_from_chars(+Chars, -Term). |
| 198 | +%% read_from_chars(+Chars, ?Term). |
199 | 199 | %
|
200 | 200 | % Given a string made of chars which contains a representation of
|
201 | 201 | % a Prolog term, Term is the Prolog term represented. Example:
|
|
206 | 206 | % ```
|
207 | 207 | read_from_chars(Chars, Term) :-
|
208 | 208 | must_be(chars, Chars),
|
209 |
| - must_be(var, Term), |
210 |
| - '$read_from_chars'(Chars, Term). |
| 209 | + '$read_from_chars'(Chars, Term0), |
| 210 | + Term = Term0. |
211 | 211 |
|
212 |
| -%% read_term_from_chars(+Chars, -Term, +Options). |
| 212 | +%% read_term_from_chars(+Chars, ?Term, +Options). |
213 | 213 | %
|
214 | 214 | % Like `read_from_chars`, except the reader is configured according to
|
215 | 215 | % `Options` which are those of `read_term`.
|
|
220 | 220 | % ```
|
221 | 221 | read_term_from_chars(Chars, Term, Options) :-
|
222 | 222 | must_be(chars, Chars),
|
223 |
| - must_be(var, Term), |
224 | 223 | builtins:parse_read_term_options(Options, [Singletons, VariableNames, Variables], read_term_from_chars/3),
|
225 |
| - '$read_term_from_chars'(Chars, Term, Singletons, Variables, VariableNames). |
| 224 | + '$read_term_from_chars'(Chars, Term0, Singletons, Variables, VariableNames), |
| 225 | + Term = Term0. |
226 | 226 |
|
227 | 227 | %% write_term_to_chars(+Term, +Options, -Chars).
|
228 | 228 | %
|
|
0 commit comments