From d43ac46eab14303fe0234abd36dc9ce75ef218b7 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 19 Jun 2024 10:54:06 -0400 Subject: [PATCH] xo-jit: example: + reqd type arg to Variable in ex1.cpp --- example/ex1/ex1.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/example/ex1/ex1.cpp b/example/ex1/ex1.cpp index 01d6073b..3929bcfa 100644 --- a/example/ex1/ex1.cpp +++ b/example/ex1/ex1.cpp @@ -41,6 +41,7 @@ main() { using xo::ast::make_apply; using xo::ast::make_var; using xo::ast::make_lambda; + using xo::reflect::Reflect; using xo::xtag; using std::cerr; using std::endl; @@ -128,13 +129,13 @@ main() { auto sin = make_primitive("sin", ::sin); auto cos = make_primitive("cos", ::cos); - auto x_var = make_var("x"); + auto x_var = make_var("x", Reflect::require()); auto call1 = make_apply(cos, {x_var}); /* (cos x) */ auto call2 = make_apply(sin, {call1}); /* (sin (cos x)) */ /* (define (lm_1 x) (sin (cos x))) */ auto lambda = make_lambda("lm_1", - {"x"}, + {x_var}, call2); log && log(xtag("expr", lambda));