diff options
author | Eduardo Julian | 2017-11-15 19:51:33 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-15 19:51:33 -0400 |
commit | 296d087530cb142efec1dea159770346bb43c3c0 (patch) | |
tree | bde43594e5df48af539a0fda3e13cbf6aa36b557 /new-luxc/source/luxc/host/macro.lux | |
parent | c4e928e5805054aa12da40baaeccbb9c522b52d0 (diff) |
- Heavy refactoring.
Diffstat (limited to 'new-luxc/source/luxc/host/macro.lux')
-rw-r--r-- | new-luxc/source/luxc/host/macro.lux | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/new-luxc/source/luxc/host/macro.lux b/new-luxc/source/luxc/host/macro.lux deleted file mode 100644 index 1a3152222..000000000 --- a/new-luxc/source/luxc/host/macro.lux +++ /dev/null @@ -1,37 +0,0 @@ -(;module: - lux - (lux (control [monad #+ do]) - (data ["e" error]) - [meta] - [host]) - (luxc [";L" host] - (lang (translation [";T" common])))) - -(for {"JVM" (as-is (host;import java.lang.reflect.Method - (invoke [Object (Array Object)] #try Object)) - (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)) - (def: _apply-args - (Array (Class Object)) - (|> (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 meta;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)]) - output)))))) - }) |