encoding/1

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1938 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2007-09-27 23:02:00 +00:00
parent c1917517cb
commit 65f093bdb7
5 changed files with 22 additions and 3 deletions

View File

@ -17,6 +17,7 @@
<h2>Yap-5.1.3:</h2>
<ul>
<li> FIXED: implement directive encoding/1 (obs from Paulo Moura).</li>
<li> UPGRADED: to current JPL.</li>
<li> FIXED: incremental garbage collection conflicts with global variables (disable it for now).</li>
<li> FIXED: trail overflow from calling dynamic predicates (obs from Bernd Gutmann).</li>

View File

@ -544,6 +544,19 @@ remove_from_path(New) :- '$check_path'(New,Path),
).
'$set_encoding'(V) :- var(V), !,
'$do_error'(instantiation_error, encoding(V)).
'$set_encoding'(EncAtom) :-
'$valid_encoding'(EncAtom, Enc), !,
'$fetch_stream_alias'(Stream,'$loop_stream'),
'$encoding'(Stream, Enc).
'$set_encoding'(EncAtom) :-
atom(EncAtom), !,
'$do_error'(domain_error(encoding,EncAtom),encoding(EncAtom)).
'$set_encoding'(EncAtom) :-
'$do_error'(type_error(atom,V),encoding(EncAtom)).
absolute_file_name(V,Out) :- var(V), !,
'$do_error'(instantiation_error, absolute_file_name(V, Out)).
absolute_file_name(user,user) :- !.

View File

@ -66,7 +66,7 @@
'$exec_directive'(initialization(D), _, M) :-
'$initialization'(M:D).
'$exec_directive'(encoding(Enc), _, _) :-
'$current_encoding'(Enc).
'$set_encoding'(Enc).
'$exec_directive'(parallel, _, _) :-
'$parallel'.
'$exec_directive'(sequential, _, _) :-

View File

@ -11,8 +11,11 @@
* File: errors.yap *
* comments: error messages for YAP *
* *
* Last rev: $Date: 2007-09-27 15:25:34 $,$Author: vsc $ *
* Last rev: $Date: 2007-09-27 23:02:00 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $
* Revision 1.81 2007/09/27 15:25:34 vsc
* upgrade JPL
*
* Revision 1.80 2007/01/24 14:20:04 vsc
* Fix typos across code
* Change debugger to backtrack more alike byrd model
@ -543,6 +546,9 @@ print_message(Level, Mss) :-
'$output_error_message'(domain_error(delete_file_option,Opt), Where) :-
format(user_error,'% DOMAIN ERROR- ~w: invalid list of options ~w~n',
[Where,Opt]).
'$output_error_message'(domain_error(encoding,Opt), Where) :-
format(user_error,'% DOMAIN ERROR- ~w: invalid encoding ~w~n',
[Where,Opt]).
'$output_error_message'(domain_error(operator_specifier,Op), Where) :-
format(user_error,'% DOMAIN ERROR- ~w: invalid operator specifier ~w~n',
[Where,Op]).

View File

@ -1045,4 +1045,3 @@ current_stream(File, Opts, Stream) :-
write_depth(T,L) :- write_depth(T,L,_).