Skip to content

Commit 10d6e22

Browse files
committed
Remove 'printService' and 'stdio' libraries
These should be reimplemented as a new IO library with an entirely new API.
1 parent f1f6ac3 commit 10d6e22

File tree

5 files changed

+22
-47
lines changed

5 files changed

+22
-47
lines changed

lib/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ build:
1313
$(COMPILER) ./HashMap.trp -l
1414
$(COMPILER) ./HashSet.trp -l
1515
# Old stuff, here be dragons...
16-
$(COMPILER) ./printService.trp -l
1716
$(COMPILER) ./timeout.trp -l
1817
$(COMPILER) ./declassifyutil.trp -l
19-
$(COMPILER) ./stdio.trp -l
2018

2119
clean:
2220
rm -rf out

lib/printService.trp

Lines changed: 0 additions & 21 deletions
This file was deleted.

lib/stdio.trp

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/rt/pos/ifc/inputpini.trp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
import stdio
21
let val out = getStdout authority
2+
3+
fun inputLineWithPini auth =
4+
let pini auth val s = inputLine ()
5+
in s
6+
end
7+
8+
fun inputLineAtLevel auth lev =
9+
let val s = inputLineWithPini auth
10+
in declassify (s, auth, lev)
11+
end
12+
313
fun writeString x = fwrite (out, x)
14+
415
val _ = writeString "Please input something: "
516
val s = inputLineAtLevel authority `{}`
617
val _ = writeString ("You have provided input: " ^ s ^ "\n")
7-
in s
8-
end
18+
19+
in s end

tests/rt/pos/ifc/tlev02.trp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import stdio
1+
let fun inputLineWithPini auth =
2+
let pini auth val s = inputLine ()
3+
in s
4+
end
25

6+
val out = getStdout authority
7+
val _ = fwrite (out, "What's your name: ")
8+
val input = inputLineWithPini authority
39

4-
let val _ = fwrite (getStdout authority, "What's your name: ")
5-
val input = inputLineWithPini authority
6-
in printString ("Hello" ^ " " ^ input )
10+
in fwrite (out, "Hello" ^ " " ^ input ^ "\n")
711
end

0 commit comments

Comments
 (0)