From c8787a29f2b77eacf7c6e003a24a38ec3070af87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Mon, 13 Feb 2012 09:36:44 +0000 Subject: [PATCH] allow weird use of atom_file_name exists_source/1. --- pl/consult.yap | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pl/consult.yap b/pl/consult.yap index 85f7b96bd..751d1cc48 100644 --- a/pl/consult.yap +++ b/pl/consult.yap @@ -631,7 +631,7 @@ absolute_file_name(File0,File) :- '$absolute_file_name'(F0,[access(read),file_type(source),file_errors(fail),solutions(first),expand(true)],F,G). absolute_file_name(File,TrueFileName,Opts) :- - var(TrueFileName), !, + ( var(TrueFileName) ; atom(TrueFileName) ), !, absolute_file_name(File,Opts,TrueFileName). absolute_file_name(File,Opts,TrueFileName) :- '$absolute_file_name'(File,Opts,TrueFileName,absolute_file_name(File,Opts,TrueFileName)). @@ -665,7 +665,7 @@ absolute_file_name(File,Opts,TrueFileName) :- '$process_fn_opt'(Opt,Extensions,RelTo,Type,Access,FErrors,Solutions,Expand,Debug,Extensions0,RelTo0,Type0,Access0,FErrors0,Solutions0,Expand0,Debug0,G), '$process_fn_opts'(Opts,Extensions0,RelTo0,Type0,Access0,FErrors0,Solutions0,Expand0,Debug0,G). '$process_fn_opts'(Opts,Extensions,RelTo,Type,Access,FErrors,Solutions,Expand,Debug,G) :- !, - '$do_error'(type_error(list,T),G). + '$do_error'(type_error(list,Opts),G). '$process_fn_opt'(Opt,Extensions,RelTo,Type,Access,FErrors,Solutions,Expand,Debug,Extensions,RelTo,Type,Access,FErrors,Solutions,Expand,Debug,G) :- var(Opt), !, '$do_error'(instantiation_error, G). @@ -1038,3 +1038,6 @@ make_library_index(_Directory). '$current_loop_stream'(Stream) :- catch(nb_getval('$loop_stream',Stream), _, fail). +exists_source(File) :- + '$full_filename'(File, AbsFile, exists_source(File)). +