package gobba

  1. Overview
  2. Docs

Source file iop.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
open Types
open Errors

let pprint_endline args =
  let x = (match args with
  | [EvtString x] -> x
  | [x] -> show_unpacked_evt x
  | _ -> iraise WrongPrimitiveArgs) in
  Printf.printf "%s\n%!" x; EvtUnit

let pprint args =
  let x = (match args with
  | [EvtString x] -> x
  | [x] -> show_unpacked_evt x
  | _ -> iraise WrongPrimitiveArgs) in
  Printf.printf "%s%!" x; EvtUnit

let table = [
  ("print",         Primitive (pprint, ("print", 1, Impure)));
  ("print_endline", Primitive (pprint_endline, ("print_endline", 1, Impure)));
]