Jonathan Graveline pushed to branch graveline at Stefan / Typer
Commits: 891026a4 by Jonathan Graveline at 2018-05-25T03:30:19Z Corrected String.sub String.concat - - - - -
1 changed file:
- src/eval.ml
Changes:
===================================== src/eval.ml ===================================== --- a/src/eval.ml +++ b/src/eval.ml @@ -298,6 +298,10 @@ let sexp_eq loc depth args_val = match args_val with | [Vsexp (s1); Vsexp (s2)] -> o2v_bool (sexp_equal s1 s2) | _ -> error loc "Sexp.= expects 2 sexps"
+let sexp_p loc depth args_val = match args_val with + | [Vsexp (s1)] -> print_string ("\n\t"^(sexp_string s1)^"\n\n"); Vsexp (s1) + | _ -> error loc "Sexp.print expects 1 sexps" + let file_open loc depth args_val = match args_val with | [Vstring (file); Vstring (mode)] -> (* open file *) (* return a file handle *) @@ -683,7 +687,10 @@ let register_builtin_functions () = ("Sexp.node" , make_node, 2); ("Sexp.dispatch" , sexp_dispatch, 7); ("String.=" , string_eq, 2); + ("String.concat" , string_concat, 2); + ("String.sub" , string_sub, 2); ("Sexp.=" , sexp_eq, 2); + ("Sexp.print" , sexp_p, 1); ("Float->String", float_to_string, 1); ("IO.bind" , io_bind, 2); ("IO.return" , io_return, 1);
View it on GitLab: https://gitlab.com/monnier/typer/commit/891026a48af57bdf26336231cad108a794d2...