Logtalk 2.22.0 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1191 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% Logtalk - Object oriented extension to Prolog
|
||||
% Release 2.21.6
|
||||
% Release 2.22.0
|
||||
%
|
||||
% Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
%
|
||||
@@ -94,6 +94,12 @@
|
||||
|
||||
|
||||
|
||||
% table of library paths
|
||||
|
||||
:- dynamic(logtalk_library_path/2). % logtalk_library_path(Library, Path)
|
||||
|
||||
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
@@ -895,8 +901,7 @@ logtalk_compile(Entities) :-
|
||||
% compiles to disk an entity or a list of entities using a list of options
|
||||
|
||||
logtalk_compile(Entity, Options) :-
|
||||
atom(Entity),
|
||||
Entity \= [],
|
||||
(atom(Entity), Entity \= []; compound(Entity), Entity \= [_| _]),
|
||||
!,
|
||||
'$lgt_make_alt_dirs',
|
||||
catch(
|
||||
@@ -930,7 +935,7 @@ logtalk_compile(Entities, Options) :-
|
||||
|
||||
'$lgt_check_compiler_entities'(Entities) :-
|
||||
\+ '$lgt_proper_list'(Entities),
|
||||
throw(type_error(atom_or_atom_list, Entities)).
|
||||
throw(type_error(entity_file_names, Entities)).
|
||||
|
||||
'$lgt_check_compiler_entities'(Entities) :-
|
||||
'$lgt_check_compiler_entity_list'(Entities).
|
||||
@@ -950,12 +955,17 @@ logtalk_compile(Entities, Options) :-
|
||||
throw(instantiation_error).
|
||||
|
||||
'$lgt_check_compiler_entity'(Entity) :-
|
||||
\+ atom(Entity),
|
||||
throw(type_error(atom, Entity)).
|
||||
compound(Entity),
|
||||
!,
|
||||
'$lgt_check_compiler_library_entity'(Entity).
|
||||
|
||||
'$lgt_check_compiler_entity'(Entity) :-
|
||||
'$lgt_file_name'(metafile, Entity, File),
|
||||
\+ '$lgt_file_exists'(File),
|
||||
\+ atom(Entity),
|
||||
throw(type_error(entity_file_name, Entity)).
|
||||
|
||||
'$lgt_check_compiler_entity'(Entity) :-
|
||||
'$lgt_file_name'(metafile, Entity, Metafile),
|
||||
\+ '$lgt_file_exists'(Metafile),
|
||||
'$lgt_file_name'(logtalk, Entity, File),
|
||||
\+ '$lgt_file_exists'(File),
|
||||
throw(existence_error(entity, Entity)).
|
||||
@@ -963,6 +973,30 @@ logtalk_compile(Entities, Options) :-
|
||||
'$lgt_check_compiler_entity'(_).
|
||||
|
||||
|
||||
'$lgt_check_compiler_library_entity'(Term) :-
|
||||
\+ Term =.. [_, _],
|
||||
throw(type_error(library_entity_file_name, Term)).
|
||||
|
||||
'$lgt_check_compiler_library_entity'(Term) :-
|
||||
Term =.. [Library, Entity],
|
||||
'$lgt_check_compiler_library_entity'(Library, Entity).
|
||||
|
||||
|
||||
'$lgt_check_compiler_library_entity'(Library, _) :-
|
||||
\+ logtalk_library_path(Library, _),
|
||||
throw(existence_error(library, Library)).
|
||||
|
||||
'$lgt_check_compiler_library_entity'(Library, Entity) :-
|
||||
once(logtalk_library_path(Library, Path)),
|
||||
'$lgt_current_directory'(Current),
|
||||
'$lgt_change_directory'(Path),
|
||||
catch(
|
||||
'$lgt_check_compiler_entity'(Entity),
|
||||
Error,
|
||||
('$lgt_change_directory'(Current), throw(Error))),
|
||||
'$lgt_change_directory'(Current).
|
||||
|
||||
|
||||
|
||||
% '$lgt_check_compiler_options'(@list)
|
||||
%
|
||||
@@ -1039,8 +1073,7 @@ logtalk_load(Entities) :-
|
||||
% or a list of entities using a list of options
|
||||
|
||||
logtalk_load(Entity, Options) :-
|
||||
atom(Entity),
|
||||
Entity \= [],
|
||||
(atom(Entity), Entity \= []; compound(Entity), Entity \= [_| _]),
|
||||
!,
|
||||
'$lgt_make_alt_dirs',
|
||||
catch(
|
||||
@@ -1127,7 +1160,7 @@ current_logtalk_flag(Flag, Value) :-
|
||||
'$lgt_default_flag'(Flag, Value),
|
||||
\+ '$lgt_current_flag_'(Flag, _).
|
||||
|
||||
current_logtalk_flag(version, version(2, 21, 6)).
|
||||
current_logtalk_flag(version, version(2, 22, 0)).
|
||||
|
||||
|
||||
|
||||
@@ -2885,6 +2918,16 @@ current_logtalk_flag(version, version(2, 21, 6)).
|
||||
%
|
||||
% compiles to disk and then loads to memory an entity
|
||||
|
||||
'$lgt_load_entity'(Term, Options) :-
|
||||
compound(Term),
|
||||
!,
|
||||
Term =.. [Library, Entity],
|
||||
once(logtalk_library_path(Library, Path)),
|
||||
'$lgt_current_directory'(Current),
|
||||
'$lgt_change_directory'(Path),
|
||||
'$lgt_load_entity'(Entity, Options),
|
||||
'$lgt_change_directory'(Current).
|
||||
|
||||
'$lgt_load_entity'(Entity, Options) :-
|
||||
'$lgt_file_name'(metafile, Entity, Metafile),
|
||||
'$lgt_file_exists'(Metafile),
|
||||
@@ -3036,6 +3079,16 @@ current_logtalk_flag(version, version(2, 21, 6)).
|
||||
%
|
||||
% compiles to disk an entity
|
||||
|
||||
'$lgt_compile_entity'(Term, Options) :-
|
||||
compound(Term),
|
||||
!,
|
||||
Term =.. [Library, Entity],
|
||||
once(logtalk_library_path(Library, Path)),
|
||||
'$lgt_current_directory'(Current),
|
||||
'$lgt_change_directory'(Path),
|
||||
'$lgt_compile_entity'(Entity, Options),
|
||||
'$lgt_change_directory'(Current).
|
||||
|
||||
'$lgt_compile_entity'(Entity, Options) :-
|
||||
'$lgt_file_name'(metafile, Entity, Metafile),
|
||||
'$lgt_file_exists'(Metafile),
|
||||
|
@@ -1,11 +1,11 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% Logtalk - Object oriented extension to Prolog
|
||||
% Release 2.21.6
|
||||
% Release 2.22.0
|
||||
%
|
||||
% configuration file for YAP Prolog 4.3.23 and later versions
|
||||
%
|
||||
% last updated: November 12, 2004
|
||||
% last updated: November 19, 2004
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
@@ -332,6 +332,22 @@ forall(Generate, Test) :-
|
||||
file_exists(File).
|
||||
|
||||
|
||||
% '$lgt_current_directory'(-atom)
|
||||
%
|
||||
% gets current working directory
|
||||
|
||||
'$lgt_current_directory'(Directory) :-
|
||||
getcwd(Directory).
|
||||
|
||||
|
||||
% '$lgt_change_directory'(+atom)
|
||||
%
|
||||
% changes current working directory
|
||||
|
||||
'$lgt_change_directory'(Directory) :-
|
||||
cd(Directory).
|
||||
|
||||
|
||||
% '$lgt_make_directory'(+atom)
|
||||
%
|
||||
% makes a new directory; succeeds if the directory already exists
|
||||
|
Reference in New Issue
Block a user