diff options
author | Eduardo Julian | 2017-11-29 22:49:56 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-29 22:49:56 -0400 |
commit | 4433c9bcd6c6cac44c018aad2e21a5b4d7cc4896 (patch) | |
tree | 0c166db6e01b41dfadd01801b5242967f2363b7d /new-luxc/source/luxc/lang/macro.lux | |
parent | 77c113a3455cdbc4bb485a94f67f392480cdcfbf (diff) |
- Adapted main codebase to the latest syntatic changes.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/macro.lux | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/new-luxc/source/luxc/lang/macro.lux b/new-luxc/source/luxc/lang/macro.lux index 4885e21db..71b140c6e 100644 --- a/new-luxc/source/luxc/lang/macro.lux +++ b/new-luxc/source/luxc/lang/macro.lux @@ -1,37 +1,35 @@ -(;module: +(.module: lux (lux (control [monad #+ do]) (data ["e" error]) [macro] [host]) - (luxc (lang [";L" host] - (translation [";T" common])))) + (luxc (lang [".L" host] + (translation [".T" common])))) -(for {"JVM" (as-is (host;import java.lang.reflect.Method +(for {"JVM" (as-is (host.import java/lang/reflect/Method (invoke [Object (Array Object)] #try Object)) - (host;import (java.lang.Class c) + (host.import (java/lang/Class c) (getMethod [String (Array (Class Object))] #try Method)) - (host;import java.lang.Object - (getClass [] (Class Object)) - (toString [] String)) - (def: _object-class (Class Object) (host;class-for Object)) + (host.import java/lang/Object) + (def: _object-class (Class Object) (host.class-for Object)) (def: _apply-args (Array (Class Object)) - (|> (host;array (Class Object) +2) - (host;array-write +0 _object-class) - (host;array-write +1 _object-class))) + (|> (host.array (Class Object) +2) + (host.array-write +0 _object-class) + (host.array-write +1 _object-class))) (def: #export (expand macro inputs) (-> Macro (List Code) (Meta (List Code))) - (do macro;Monad<Meta> - [class (commonT;load-class hostL;function-class)] + (do macro.Monad<Meta> + [class (commonT.load-class hostL.function-class)] (function [compiler] - (do e;Monad<Error> - [apply-method (Class.getMethod ["apply" _apply-args] class) - output (Method.invoke [(:! Object macro) - (|> (host;array Object +2) - (host;array-write +0 (:! Object inputs)) - (host;array-write +1 (:! Object compiler)))] - apply-method)] - (:! (e;Error [Compiler (List Code)]) + (do e.Monad<Error> + [apply-method (Class::getMethod ["apply" _apply-args] class) + output (Method::invoke [(:! Object macro) + (|> (host.array Object +2) + (host.array-write +0 (:! Object inputs)) + (host.array-write +1 (:! Object compiler)))] + apply-method)] + (:! (e.Error [Compiler (List Code)]) output)))))) }) |