File: complexe.ml

package info (click to toggle)
ocaml-doc 3.09-1
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 10,428 kB
  • ctags: 4,963
  • sloc: ml: 9,244; makefile: 2,413; ansic: 122; sh: 49; asm: 17
file content (17 lines) | stat: -rw-r--r-- 384 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
let c = ref 0;;

let parse_gui_message () =
  let s = input_line stdin in
  match s with
  | "bouton" -> incr c; string_of_int !c
  | s -> "syntax error: " ^ s;;

let treat() =
  let answer = parse_gui_message() in
  output_string stdout answer;
  output_char stdout '\n';
  flush stdout;;

let computation_server () =
  try while true do treat () done
  with End_of_file -> exit 0;;