home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lifeos2.zip / LIFE-1.02 / SOURCE / ONLINEDO.LF < prev    next >
Text File  |  1996-06-04  |  3KB  |  117 lines

  1. %    $Id: onlinedoc.lf,v 1.2 1994/12/08 23:31:40 duchier Exp $    
  2. %%% routine to give information on symbols online
  3.  
  4. %module("built_in") ?
  5.  
  6. public(add_man,man) ?
  7.  
  8. persistent(online_info) ?
  9.  
  10. non_strict(add_man) ?
  11.  
  12. add_man(X,S) :-
  13.     S :< string,
  14.     cond( X :< list,
  15.           ( true |
  16.         S1 <<- S,
  17.         info_list(X,S1)
  18.           ),
  19.           one_info(X,S)
  20.         ).
  21.  
  22. info_list([X|L],S) :-
  23.     !,
  24.     one_info(X,S),
  25.     info_list(L,S).
  26. info_list([]):- !.
  27.  
  28. one_info(X,S) :-
  29.     Module = current_module,
  30.     online_info.current_module.X <<- S.
  31.  
  32.  
  33. non_strict(man) ?
  34. persistent(exits_entry) ?
  35. op(1200,fy,man) ?
  36.  
  37. man(X) :-
  38.     man2(features(online_info),psi2str(X),false).
  39.  
  40. man2([A|B],S,Entry) :-
  41.     !,
  42.     (
  43.         has_feature(S,online_info.A,Info),!,
  44.         write("In module: ",A,","),nl,nl,
  45.         write(Info),
  46.         nl,
  47.         nl,
  48.         man2(B,S,true)
  49.     ;
  50.         man2(B,S,Entry)
  51.     ).
  52. man2([],S,Entry) :-
  53.     cond( Entry,
  54.           succeed,
  55.           (write(" No manual entry for ",S),nl)
  56.         ).
  57.  
  58.  
  59. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  60. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  61. %
  62. % Built-ins documentation
  63. %
  64. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  65. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  66.  
  67. add_man(add_man,
  68.     " add_man(X,S) ?
  69.  
  70.   input: X is a symbol name, or a list of symbol names;
  71.          S is a string containing the information describing X. 
  72.  
  73.   add_man stores the information describing its first argument. 
  74.   ") ?
  75.  
  76. add_man((man),
  77.     " man X ?
  78.  
  79.   input: X is a symbol name.
  80.  
  81.   ""man"" reads information about X stored by ""add_man"",
  82.   and writes it on the standard output. 
  83.   ") ? 
  84.  
  85. add_man(reconsult,
  86.     " reconsult(File1,File2,...) ?
  87.  
  88.   input: File1, File2,... : strings (file names)
  89.  
  90.   reconsult(File1,File2,...) is a facility offered to avoid restarting 
  91.   Wild_Life each time you make a minor modification to a file. It works 
  92.   properly in 90% of the cases, but there are some limitations. 
  93.  
  94.   1) reconsult may only be used with expand_load(true).
  95.   2) reconsult retracts the definitions of the functions and predicates 
  96.      occurring in the previous version of the file, then reloads the 
  97.      file, reexecuting the queries and directives. 
  98.  
  99.   3) Warnings:
  100.  
  101.      - if a function or predicate was defined across multiple files,
  102.        the whole definition is retracted, not only the rules that 
  103.        appeared in the reconsulted file.
  104.      - Sort declarations are never retracted. It means that the sort 
  105.        hierarchy can be only be extended.
  106.      - Some directives have non-retractable side-effects: 
  107.        public,private,private_feature,dynamic,static,non_strict,
  108.        strict,op,global,persistent.
  109.      - If a query in the file asserts rules, these rules are not 
  110.        retracted when reconsulting the file. This should anyway never 
  111.        occur: use expanders, and end your rules with a dot.
  112.  
  113.   4) Files are identified by the complete name (path included) used 
  114.      to load them. It means that you may have problems if you don't 
  115.      use the same name to load and reconsult the file.
  116.   ") ?
  117.