From 1062b6e456aa0b446b81a706e41df6e546c5ad44 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 16 Apr 2019 20:55:39 -0400 Subject: Now using generation for host extensions. --- new-luxc/source/program.lux | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'new-luxc/source/program.lux') diff --git a/new-luxc/source/program.lux b/new-luxc/source/program.lux index 23384cf17..661858e40 100644 --- a/new-luxc/source/program.lux +++ b/new-luxc/source/program.lux @@ -1,6 +1,6 @@ (.module: [lux #* - ["." host (#+ import:)] + ["@" host (#+ import:)] [abstract [monad (#+ do)]] [control @@ -9,7 +9,8 @@ [data ["." error (#+ Error)] [collection - [array (#+ Array)]]] + [array (#+ Array)] + ["." dictionary]]] [world ["." file]] [tool @@ -33,7 +34,8 @@ ["." runtime] ["." expression] [procedure - ["." common]]]]]]) + ["." common] + ["." host]]]]]]) (import: #long java/lang/reflect/Method (invoke [java/lang/Object (Array java/lang/Object)] #try java/lang/Object)) @@ -46,13 +48,13 @@ (def: _object-class (java/lang/Class java/lang/Object) - (host.class-for java/lang/Object)) + (@.class-for java/lang/Object)) (def: _apply-args (Array (java/lang/Class java/lang/Object)) - (|> (host.array (java/lang/Class java/lang/Object) 2) - (host.array-write 0 _object-class) - (host.array-write 1 _object-class))) + (|> (@.array (java/lang/Class java/lang/Object) 2) + (@.array-write 0 _object-class) + (@.array-write 1 _object-class))) (def: (expander macro inputs lux) Expander @@ -64,9 +66,9 @@ (:coerce (Error (Error [Lux (List Code)])) (java/lang/reflect/Method::invoke (:coerce java/lang/Object macro) - (|> (host.array java/lang/Object 2) - (host.array-write 0 (:coerce java/lang/Object inputs)) - (host.array-write 1 (:coerce java/lang/Object lux))) + (|> (@.array java/lang/Object 2) + (@.array-write 0 (:coerce java/lang/Object inputs)) + (@.array-write 1 (:coerce java/lang/Object lux))) apply-method)))) (def: jvm @@ -145,4 +147,9 @@ $i.RETURN))))])) (program: [{service /cli.service}] - (/.compiler ..expander ..jvm common.bundle ..program service)) + (/.compiler ..expander + ..jvm + (dictionary.merge common.bundle + host.bundle) + ..program + service)) -- cgit v1.2.3