Skip to content

Instantly share code, notes, and snippets.

@objmagic
Created June 29, 2015 15:26
Show Gist options
  • Select an option

  • Save objmagic/16c4d49a9ee5acc06d70 to your computer and use it in GitHub Desktop.

Select an option

Save objmagic/16c4d49a9ee5acc06d70 to your computer and use it in GitHub Desktop.
unbound
type t = {a:int; b:int}
let init () = {a=1; b=1}
module T = struct
open A
let f () = .<fun s -> s.a>.
end
let () =
let open A in
let t = A.init () in
let r_code = .< .~(T.f()) t >. in
print_int (Runcode.run r_code)
(*
File "staging_parser.ml", line 21, characters 23-28:
Error: Unbound module Normal_parser
Fatal error: exception Failure("Error type-checking generated code: scope extrusion?")
*)
#
# Build system for ocs library and interpreter
#
OCAMLBUILD = ocamlbuild
METAOCAMLC = metaocamlc
build:
$(OCAMLBUILD) -classic-display -ocamlc $(METAOCAMLC) a.byte b.byte
clean:
ocamlbuild -clean
.PHONY: byte clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment