formatting changes

This commit is contained in:
Vitor Santos Costa 2014-09-23 22:40:40 +01:00
parent ed3f0a8b74
commit 2bc55d868d

View File

@ -387,7 +387,7 @@ save_program(File, _Goal) :-
call(db_import(myddas,Table,Table)), call(db_import(myddas,Table,Table)),
fail. fail.
'$myddas_import_all'. '$myddas_import_all'.
/** @pred qsave_file(+ _File_, +_State_) /** @pred qsave_file(+ _File_, +_State_)
Saves an image of all the information compiled by the systemm from file _F_ to _State_. Saves an image of all the information compiled by the systemm from file _F_ to _State_.
@ -408,27 +408,35 @@ qsave_file(File, State) :-
close(S), close(S),
abolish(Mod:'@mod_info'/7), abolish(Mod:'@mod_info'/7),
fail. fail.
qsave_file(_). qsave_file(_,_).
/** @pred qsave_module(+ _Module_, +_State_) /** @pred qsave_module(+ _Module_, +_State_)
Saves an image of all the information compiled by the systemm on module _F_ to _State_. Saves an image of all the information compiled by the systemm on module _F_ to _State_.
**/ **/
qsave_module(Mod, OF) :- qsave_module(Mod, OF) :-
recorded('$module', '$module'(F,Mod,Exps,L), _), recorded('$module', '$module'(F,Mod,Exps,L),_),
'$fetch_parents_module'(Mod, Parents), '$fetch_parents_module'(Mod, Parents),
'$fetch_imports_module'(Mod, Imps), '$fetch_imports_module'(Mod, Imps),
'$fetch_multi_files_module'(Mod, MFs), '$fetch_multi_files_module'(Mod, MFs),
'$fetch_meta_predicates_module'(Mod, Metas), '$fetch_meta_predicates_module'(Mod, Metas),
'$fetch_module_transparents_module'(Mod, ModTransps), '$fetch_module_transparents_module'(Mod, ModTransps),
asserta(Mod:'@mod_info'(F, Exps, L, Parents, Imps, Metas, ModTransps)), asserta(Mod:'@mod_info'(F, Exps, L, Parents, Imps, Metas, ModTransps))
atom_concat(Mod,'.qly',OF), , atom_concat(Mod,'.qly',OF),
open(OF, write, S, [type(binary)]), open(OF, write, S, [type(binary)]),
'$qsave_module_preds'(S, Mod), '$qsave_module_preds'(S, Mod), close(S),
close(S), abolish(Mod:'@mod_info'/7),
abolish(Mod:'@mod_info'/7), fail.
fail. qsave_module(_,_).
qsave_module(_).
/** @pred qsave_module(+ _Module_, +_State_)
Saves an image of all the information compiled by the systemm on module _F_ to _State_.
**/
qsave_module(Mod) :-
atom_concat( Mod, '.qly', F),
qsave_module( Mod, F).
/** /**
@pred restore(+ _F_) @pred restore(+ _F_)
@ -455,14 +463,20 @@ qload_module(Mod) :-
'$complete_read'(Mod). '$complete_read'(Mod).
'$complete_read'(Mod) :- '$complete_read'(Mod) :-
retract(Mod:'@mod_info'(F, Exps, Line,Parents, Imps, Metas, ModTransps)), '$current_module'(HostMod),
abolish(Mod:'$mod_info'/7), retract(Mod:'@mod_info'(F, Exps, Line,Parents, Imps, Metas, ModTransps)),
recorda('$module', '$module'(F,Mod,Exps,Line), _), abolish(Mod:'$mod_info'/7),
'$install_parents_module'(Mod, Parents), '$install_parents_module'(Mod, Parents),
'$install_imports_module'(Mod, Imps), '$install_imports_module'(Mod, Imps),
'$install_multi_files_module'(Mod, MFs), '$install_multi_files_module'(Mod, MFs),
'$install_meta_predicates_module'(Mod, Metas), '$install_meta_predicates_module'(Mod, Metas),
'$install_module_transparents_module'(Mod, ModTransps). '$install_module_transparents_module'(Mod, ModTransps),
% last, export everything to the host: if the loading crashed you didn't actually do
% no evil.
'$convert_for_export'(all, Exps, Mod, HostMod, TranslationTab, AllExports0, qload_module),
'$add_to_imports'(TranslationTab, Mod, HostMod), % insert ops, at least for now
sort( AllExports0, AllExports ),
recorda('$module','$module'(F,Mod,F,AllExports, Line),_).
'$fetch_imports_module'(Mod, Imports) :- '$fetch_imports_module'(Mod, Imports) :-
findall(Info, '$fetch_import_module'(Mod, Info), Imports). findall(Info, '$fetch_import_module'(Mod, Info), Imports).