-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathsimple.m
64 lines (50 loc) · 1.25 KB
/
simple.m
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
% simple22
% test
% the test is just that this compiles
% (testing the generate_unify in bytecode_gen.m)
% --------------------------------------------------------------------------
:- module simple.
% --------------------------------------------------------------------------
:- interface.
:- import_module io.
:- import_module int.
:- import_module char.
:- pred main(io__state, io__state).
:- mode main(di, uo) is det.
% --------------------------------------------------------------------------
:- implementation.
main -->
{
dothings
}.
% ------------------------------------------
:- func sgetch = character is det.
sgetch = 'a'.
:- pred checkch is det.
checkch :- ( sgetch = sgetch
-> true ; true).
% ---------------------------------
:- func sgets = string is det.
sgets = "a".
:- pred checks is det.
checks :- ( sgets = sgets
-> true ; true).
% ---------------------------------
:- func sgeti = int is det.
sgeti = 3.
:- pred checki is det.
checki :- ( sgeti = sgeti
-> true ; true).
% ---------------------------------
:- func sgetf = float is det.
sgetf = 3.0.
:- pred checkf is det.
checkf :- ( sgetf = sgetf
-> true ; true).
% -----------------------------------------------
:- pred dothings is det.
dothings :-
checkch,
checks,
checki,
checkf.