fork download
  1. let exch chr =
  2. match chr with
  3. 'a' -> 'C'
  4. |'b' -> 'A'
  5. |'c' -> 'D'
  6. |'d' -> 'B';;
  7.  
  8. let rec crypt str ?(num=0) =
  9. str.[num] <- exch (str.[num]);;
  10. if num <= String.length str then crypt str (num+1);;
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
File "prog.ml", line 2, characters 0-69:
Warning P: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
'e'
File "prog.ml", line 8, characters 25-26:
Warning X: this optional argument cannot be erased.
File "prog.ml", line 10, characters 5-8:
Unbound value num
stdout
Standard output is empty