Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
stringp.ml1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33open Types open Errors open Typecheck (* open Util *) (** String Primitives *) let string_binop (op : string -> string -> string) args = let (x, y) = match args with | [x; y] -> (unpack_string x, unpack_string y) | _ -> iraise WrongPrimitiveArgs in EvtString (op x y) let string_unop (op : string -> string) args = let x = match args with | [x] -> unpack_string x | _ -> iraise WrongPrimitiveArgs in EvtString (op x) let compare (comp: (int -> int -> bool)) args = let (x,y) = match args with | [x;y] -> (x, y) | _ -> iraise WrongPrimitiveArgs in EvtBool(comp (compare_evt x y) 0) let concat args = match args with | [x;y] -> EvtString ((unpack_string x) ^ (unpack_string y)) | _ -> iraise WrongPrimitiveArgs let table = [ ("concat", Primitive (concat, ("concat", 2, Pure))); ]