summaryrefslogtreecommitdiffstats
path: root/camlp4/examples/fancy_lambda_quot_test.ml
diff options
context:
space:
mode:
Diffstat (limited to 'camlp4/examples/fancy_lambda_quot_test.ml')
-rw-r--r--camlp4/examples/fancy_lambda_quot_test.ml36
1 files changed, 0 insertions, 36 deletions
diff --git a/camlp4/examples/fancy_lambda_quot_test.ml b/camlp4/examples/fancy_lambda_quot_test.ml
deleted file mode 100644
index 9f74deea6..000000000
--- a/camlp4/examples/fancy_lambda_quot_test.ml
+++ /dev/null
@@ -1,36 +0,0 @@
-(****************************************************************************)
-(* *)
-(* OCaml *)
-(* *)
-(* INRIA Rocquencourt *)
-(* *)
-(* Copyright 2008 Institut National de Recherche en Informatique et *)
-(* en Automatique. All rights reserved. This file is distributed under *)
-(* the terms of the GNU Library General Public License, with the special *)
-(* exception on linking described in LICENSE at the top of the OCaml *)
-(* source tree. *)
-(* *)
-(****************************************************************************)
-
-open Fancy_lambda_quot.LambdaSyntax;;
-let _loc = Camlp4.PreCast.Loc.ghost;;
-let rec propagate = function
- | << $f$ $x$ $y$ >> ->
- begin match propagate f, propagate x, propagate y with
- | f, << $int:i$ >>, << $int:j$ >> ->
- begin match f with
- | << plus >> -> << $int:i + j$ >>
- | << minus >> -> << $int:i - j$ >>
- | << times >> -> << $int:i * j$ >>
- | << div >> -> << $int:i / j$ >>
- | _ -> << $f$ $int:i$ $int:j$ >>
- end
- | f, x, y -> << $f$ $x$ $y$ >>
- end
- | << $f$ $x$ >> -> << $propagate f$ $propagate x$ >>
- | << fun $x$ -> $e$ >> -> << fun $x$ -> $propagate e$ >> (* here x should not be a primitive like plus *)
- | << $var:_$ >> | << $int:_$ >> as e -> e
-;;
-
-let ex1 = propagate << f (fun x -> g (plus 3 (times 4 42)) (minus 1 (x 3))) >>
-;;