-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathle_local.pl
More file actions
executable file
·40 lines (29 loc) · 1.1 KB
/
le_local.pl
File metadata and controls
executable file
·40 lines (29 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* le_local: a prolog module for LE handling of a local filesystem.
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
:- module(le_local,
[load_file_module/3,
this_capsule/1,
portray_clause_ind/1,
update_file/3,
myDeclaredModule/1
]).
load_file_module(FileName, FileName, _) :-
load_files([FileName], [module(FileName)]).
% HACK: to support le_cli.pl, which dislikes the user module for LE programs:
this_capsule(user):- \+ no_user_module.
:- dynamic no_user_module/0.
%thread_self(M). % current_module(M) messes it up
portray_clause_ind(Clause) :-
portray_clause(Clause).
:- multifile kp_loader:myDeclaredModule/1.
myDeclaredModule(user).
update_file(NewFileName, _, String) :-
open(NewFileName, write, Stream, []),
write(Stream, String),
close(Stream).