Use ##... for types. Don't use `Macro` for special forms
* btl/unit.typer, btl/list.typer, btl/macro.typer: Remove, unused. * btl/builtins.typer: Rename from types.typer. (Unit): Define as inductive, rather than builtin. (unit): New predefined constant. (Int, Float, String, Sexp, Context, IO, FileHandle, Attribute): Remove built-in types, now declared in OCaml. (new-attribute, get-attribute, has-attribute, add-attribute, decltype) (declexpr): Remove special forms, now declared in OCaml. * src/builtin.ml (predef_name): Remove "Attribute", unused. (add_builtin_type): New function. Add all builtin sorts and types. * src/debruijn.ml (sort_level): Rename from type_level. (sort_omega): Rename from type_omega. (type_level): New type. * src/lparse.ml (macromap): Move. (special_forms): Rename from make_macro_map; make it a ref cell rather than a function of no arguments. (type_special_form): New built-in type. (add_special_form): New function. (get_special_form): Rename from get_macro_impl, rewrite. (infer_call.handle_funcall): Use mkBuiltin. Remove the single-arg form of `Built-in`. (infer_call): Don't use the `Macro` to indicate a special form. (builtin_macro, is_builtin_macro): Remove. (<toplevel>): Register special forms. (default_lctx): Add entries predefined in BI.lmap. before loading types.typer. * src/opslexp.ml (conv_p) <Inductive>: Fix scoping of fields. (sort_level_max): Hash-cons return value. (check'): Check the type provided to `Builtin`. Hash cons the sorts as well. (erase_type): Silence compiler warning.
Loading
Please register or sign in to comment