Commits

Paweł Wieczorek  committed 25b5cf3

tagged

  • Participants
  • Parent commits b19d0ec

Comments (0)

Files changed (3)

 SOURCE_DIRS=\
 	-Is src\
 
-
 DEMO_DIRS=\
 	-Is demo\
 

File demo/Demo.ml

     let app_priority = psp_max_priority - 50
 
     let prio_expr = function
-        | Binop _
         | Var _ -> psp_max_priority
         | App _ -> app_priority
         | Abs _ -> app_priority - 1
+        | Binop _ -> app_priority - 1
         | Let _ -> app_priority - 1
 
 
         ; mk_pair
             "fun x -> (f g)"
             (Abs("x", App(expr_f, expr_g)))
+
+        ; mk_pair
+            "(fun x -> x) (let x = f in g)"
+            (App(expr_abs_x_x, expr_let_x_f_g))
+
+        ; mk_pair
+            "(let x = f in g) (let x = f in g)"
+            (App(expr_let_x_f_g, expr_let_x_f_g))
+
+        ; mk_pair
+            "h (let x = f in g)"
+            (App(expr_h, expr_let_x_f_g))
+
+        ; mk_pair
+            "h (fun x -> x)"
+            (App(expr_h, expr_abs_x_x))
         ]
 
     
 end
 
 
-let _ = print_endline "ArithmeticExpressions"
+let _ = print_endline "ArithmeticExpressions"; print_newline ()
 
 let _ = ArithmeticExpressions.test ()
 
-let _ = print_endline "Lambda"
+let _ = print_endline "Lambda"; print_newline ()
 
 let _ = Lambda.test ()

File demo/Makefile

-OCAMLBUILD= ocamlbuild 
+OCAMLC=ocamlc
 
-DEMO=Demo.native
+DEMO=Demo.byte
 
 .PHONY : ${DEMO}
 
 all: ${DEMO}
 
-${DEMO}: ${LIBS}
-	${OCAMLBUILD} -use-ocamlfind ${DEMO_DIRS} ${DEMO}
+${DEMO}: Demo.ml
+	${OCAMLC} -I ../_build/src -o ${DEMO} StringPainter.cma Demo.ml
 
 clean:
-	${OCAMLBUILD} ${DEMO_DIRS} ${SOURCE_DIRS} ${DEMO} -clean
-
+	rm -f ${DEMO} Demo.cmo Demo.cmi