Logtalk 2.26.2 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1486 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.25.1
|
||||
Release 2.26.2
|
||||
|
||||
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.25.1
|
||||
Release 2.26.2
|
||||
|
||||
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
@@ -19,7 +19,7 @@ Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
Syntax error: Operator expected
|
||||
|
||||
|
||||
% you must use instead:
|
||||
% you must use instead functor notation:
|
||||
|
||||
| ?- double::double(I, J).
|
||||
|
||||
@@ -49,3 +49,7 @@ I = 3
|
||||
J = 9
|
||||
|
||||
Yes
|
||||
|
||||
|
||||
% check the file "previous.txt" generated from the file "next.txt" by the object "reverse"
|
||||
% by opening the files on a text editor
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
:- public(double/2).
|
||||
|
||||
:- op(500, xfx, double).
|
||||
:- op(500, xfx, double). % local object operators, not visible outside this object
|
||||
|
||||
|
||||
1 double 2.
|
||||
|
||||
@@ -4,3 +4,12 @@
|
||||
double,
|
||||
triple,
|
||||
reverse])).
|
||||
|
||||
/*
|
||||
If you intend to use the FOP XSL:FO processor for generating PDF documenting
|
||||
files, comment the directive above and uncomment the directive below
|
||||
|
||||
:- initialization(
|
||||
logtalk_load(
|
||||
[double, triple, reverse], [xmlsref(standalone)])).
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
date is 2004/2/16,
|
||||
comment is 'Reads and writes a simple table of facts from and to files for testing operator handling code.']).
|
||||
|
||||
:- op(500, xfx, next).
|
||||
:- op(500, xfx, next). % local object operators, not visible outside this object
|
||||
:- op(500, xfx, previous).
|
||||
|
||||
:- initialization(reverse_file).
|
||||
@@ -17,7 +17,7 @@
|
||||
reverse_file :-
|
||||
open('next.txt', read, RStream),
|
||||
open('previous.txt', write, WStream),
|
||||
read(RStream, Term),
|
||||
read(RStream, Term), % local operators are used when reading terms ...
|
||||
process(Term, RStream, WStream).
|
||||
|
||||
process(end_of_file, RStream, WStream) :-
|
||||
@@ -25,7 +25,8 @@
|
||||
close(WStream).
|
||||
|
||||
process(X next Y, RStream, WStream) :-
|
||||
write(WStream, Y previous X), write(WStream, '.'), nl(WStream),
|
||||
write(WStream, Y previous X), % ... and when writing terms
|
||||
write(WStream, '.'), nl(WStream),
|
||||
read(RStream, Next),
|
||||
process(Next, RStream, WStream).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user