a.cd 698 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
let f (g : Byte -> Byte)(s : Latin1) : Latin1 = map s with x -> g x

let x = ref Byte 'a'

let g (r : ref Byte) : [] = r := 'a'

let re (c : { x = Float }) : Float = c . x

let diag (x : Float) : {| x = Float; y = Float |} = { x = x; y = x }

let map_complex (f : (Float,Float)->Float)(c : { x = Float; y = Float }) 
: Float = 
  f (c . x, c . y)


let pp (x : Any) : Latin1 = string_of x
17
18
19
20
21
22
23


let exists = external "Sys.file_exists"

let i = 1

let home = external "Sys.getenv" "HOME"
24

25
let stdin : !Unix.file_descr = external "Unix.stderr"
26
27
28
29
let unix_write = external "Unix.write"
let str_len = external "String.length"

let _ = unix_write stdin home 0 (str_len home)
30

31
let [] = external "Unix.sleep" 3