[m-dev.] for review: address Fergus' review of the curses extras package
Robert Ernst Johann JESCHOFNIK
rejj at students.cs.mu.oz.au
Mon Feb 7 11:22:41 AEDT 2000
Estimated hours taken: 0.2
Address Fergus' review.
README:
Add a (brief) description of what curses actually is
curses/basics.m:
curses/misc.m:
curses/user.m:
Fix the :- module statements to use "__" instead of ":"
Fix spelling errors
Fix up a few comments
Index: README
===================================================================
RCS file: /home/mercury1/repository//mercury/extras/README,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- README 2000/01/14 07:20:43 1.6
+++ README 2000/01/31 03:12:20 1.7
@@ -13,7 +13,8 @@
complex and imaginary numbers.
curses A Mercury library providing a (partial) binding to
- curses.
+ curses; a package that provides methods for manipulating
+ the text screen (creating windows, placing characters, etc).
dynamic_linking
An interface to the C functions dlopen(), dlsym(), etc.
Index: curses//basics.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/curses/basics.m,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- curses//basics.m 2000/01/14 07:21:29 1.1
+++ curses//basics.m 2000/01/31 03:12:54 1.2
@@ -26,12 +26,12 @@
%
%----------------------------------------------------------------------------%
-:- module mcurses:basics.
+:- module mcurses__basics.
:- interface.
:- import_module char, int, io, string.
- % Initilise curses. This is used by user.m, and should not be called by the
+ % Initialise curses. This is used by user.m, and should not be called by the
% programmer.
:- pred init(io__state, io__state).
:- mode init(di, uo) is det.
@@ -41,8 +41,8 @@
:- pred endwin(io__state, io__state).
:- mode endwin(di, uo) is det.
- % Initilise the colour mode for curses. This must be called before attempting
- % to use anything with colour.
+ % Initialise the colour mode for curses. This must be called before
+ % attempting to use anything with colour.
:- pred start_colour(io__state, io__state).
:- mode start_colour(di, uo) is det.
Index: curses//misc.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/curses/misc.m,v
retrieving revision 1.1
diff -u -r1.1 misc.m
--- curses//misc.m 2000/01/14 07:21:30 1.1
+++ curses//misc.m 2000/02/04 01:08:20
@@ -13,7 +13,7 @@
%
%----------------------------------------------------------------------------%
-:- module mcurses:misc.
+:- module mcurses__misc.
:- interface.
:- import_module array, int.
@@ -25,27 +25,28 @@
%
% Example:
%
- % for(0, 5, (pred(Num::in, IO1::di, IO2::uo) is det :-
- % io__print(Num, IO1, IO2)
- % ), IO0, IO)
+ % main -->
+ % for(0, 5, (pred(Num::in, di, uo) is det -->
+ % io__print(Num)
+ % )).
%
- % Would print "12345".
+ % Would print "012345".
:- pred for(int, int, pred(int, T, T), T, T).
:- mode for(in, in, pred(in, in, out) is det, in, out) is det.
:- mode for(in, in, pred(in, in, out) is semidet, in, out) is semidet.
:- mode for(in, in, pred(in, di, uo) is det, di, uo) is det.
:- mode for(in, in, pred(in, array_di, array_uo) is det,
- array_di, array_uo) is det.
+ array_di, array_uo) is det.
%----------------------------------------------------------------------------%
:- implementation.
for(Min, Max, Pred, Acc0, Acc) :-
- ( Min =< Max ->
- Pred(Min, Acc0, Acc1),
- for(Min+1, Max, Pred, Acc1, Acc)
- ;
- Acc = Acc0
- ).
+ ( Min =< Max ->
+ Pred(Min, Acc0, Acc1),
+ for(Min + 1, Max, Pred, Acc1, Acc)
+ ;
+ Acc = Acc0
+ ).
Index: curses//user.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/curses/user.m,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- curses//user.m 2000/01/14 07:21:30 1.1
+++ curses//user.m 2000/01/31 03:12:54 1.2
@@ -22,7 +22,7 @@
% * Colour on a character by character basis.
%
%----------------------------------------------------------------------------%
-:- module mcurses:user.
+:- module mcurses__user.
:- interface.
:- import_module char, io, list, std_util.
@@ -73,7 +73,9 @@
:- type chtype == pair(char, list(cattr)).
% init(Root, IO0, IO)
- % initilise curses, giving back the root window.
+ % Initialise curses, giving back the root window.
+ % The initialisation procedures in this library turn off echoing, and
+ % enable character-at-a-time input.
:- pred init(win, io__state, io__state).
:- mode init(out, di, uo) is det.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list