From 70aa7154e64c0ab2352c00e5f993e88737929ccc Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 25 Jan 2023 17:40:20 -0400 Subject: Can now compile functions (and apply them) in C++. --- lux-c++/source/program.lux | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lux-c++/source') diff --git a/lux-c++/source/program.lux b/lux-c++/source/program.lux index 3f734b572..1094c455a 100644 --- a/lux-c++/source/program.lux +++ b/lux-c++/source/program.lux @@ -131,7 +131,7 @@ [variant_right? Bit] [variant_choice Value] - [tuple_arity Nat] + [tuple::arity Nat] ) (def (lux_variant lefts right? choice) @@ -145,23 +145,23 @@ (array.has! 2 choice) ..tuple)) -(def (tuple_member @ member it) +(def (tuple::member @ member it) (-> Runtime Nat Any Value) (let [on (as (-> Nat Any Value) - (getattr @ /runtime.tuple_member))] + (getattr @ /runtime.tuple::member))] (on member it))) (def (lux_tuple @ lux_value input) (-> Runtime (-> Runtime Any Value) Any Any) - (let [arity (tuple_arity @ input)] + (let [arity (tuple::arity @ input)] (loop (next [member 0 output (array.empty arity)]) (if (n.< arity member) (next (++ member) - (array.has! member (lux_value @ (tuple_member @ member input)) + (array.has! member (lux_value @ (tuple::member @ member input)) output)) output)))) @@ -188,12 +188,12 @@ /runtime.tuple_tag (lux_tuple @ lux_value it) - ... /runtime.function_tag + /runtime.function_tag + it tag (panic! (when tag 2 "F64" - 6 "FUNCTION" _ "???")))) (def host @@ -290,7 +290,7 @@ (def _ (program [service cli.service] - (let [context (context.jvm (cli.target service))] + (let [context (context.c++ (cli.target service))] (exec (do async.monad [[host platform] (async.future ..platform) -- cgit v1.2.3