From 5d966928b9fed2716c008592c2c4735abea9d0c1 Mon Sep 17 00:00:00 2001 From: Costa Vitor Date: Wed, 1 Jul 2009 12:11:33 -0500 Subject: [PATCH] prolog_file_name/2 was missing --- pl/yio.yap | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pl/yio.yap b/pl/yio.yap index 2728bb026..ecaaa79d9 100644 --- a/pl/yio.yap +++ b/pl/yio.yap @@ -520,8 +520,7 @@ nl(Stream) :- '$put'(Stream,10). nl :- current_output(Stream), '$put'(Stream,10), fail. nl. -write(T) :- - '$write'(4, T). +write(T) :- '$write'(4, T). writeln(T) :- '$write'(4, T), @@ -1114,3 +1113,13 @@ stream_position_data(byte_count, '$stream_position'(Data,_,_,_,_), Data). nb_setval('$open_expands_filename',false). '$set_default_expand'(V) :- !, '$do_error'(domain_error(flag_value,V),yap_flag(open_expands_file_name,X)). + +prolog_file_name(File, PrologFileName) :- + var(File), !, + '$do_error'(instantiation_error, prolog_file_name(File, PrologFileName)). +prolog_file_name(user, Out) :- !, Out = user. +prolog_file_name(File, PrologFileName) :- + atom(File), !, + system:true_file_name(File, PrologFileName). +prolog_file_name(File, PrologFileName) :- + '$do_error'(type_error(atom,T), prolog_file_name(File, PrologFileName)).