diff options
author | Eduardo Julian | 2019-04-15 20:17:19 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-04-15 20:17:19 -0400 |
commit | e75aa067fc8b1f60f2adae9875fac7960db4de24 (patch) | |
tree | be5ab9595610952c25c83636ff5fddf02a2a97b0 /stdlib/source | |
parent | d3444a45d289e75e64037d2b402dde18db6aa04f (diff) |
Removed the (deemed unnecessary) host extensions for the scripting languages.
Diffstat (limited to '')
11 files changed, 11 insertions, 231 deletions
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/extension.lux b/stdlib/source/lux/tool/compiler/phase/generation/js/extension.lux index a40b4953f..3bc0a0887 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/js/extension.lux +++ b/stdlib/source/lux/tool/compiler/phase/generation/js/extension.lux @@ -6,10 +6,8 @@ [// [runtime (#+ Bundle)]] [/ - ["." common] - ["." host]]) + ["." common]]) (def: #export bundle Bundle - (|> common.bundle - (dictionary.merge host.bundle))) + common.bundle) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/js/extension/host.lux b/stdlib/source/lux/tool/compiler/phase/generation/js/extension/host.lux deleted file mode 100644 index f78daf215..000000000 --- a/stdlib/source/lux/tool/compiler/phase/generation/js/extension/host.lux +++ /dev/null @@ -1,122 +0,0 @@ -(.module: - [lux #* - [abstract - ["." monad (#+ do)]] - [data - ["." product] - [collection - ["." dictionary]]] - [host - ["_" js (#+ Expression)]]] - ["." /// #_ - ["#." runtime (#+ Handler Bundle)] - ["#/" // #_ - ["#." extension (#+ Nullary Unary Binary Trinary Variadic - nullary unary binary trinary variadic)] - ["#/" // - ["#." extension - ["." bundle]] - ["#/" // #_ - ["#." synthesis]]]]]) - -(template [<name> <js>] - [(def: (<name> _) (Nullary Expression) <js>)] - - [js//null _.null] - [js//undefined _.undefined] - [js//object (_.object (list))] - ) - -(def: (js//global name generate inputs) - Handler - (case inputs - (^ (list (//////synthesis.text global))) - (:: /////.monad wrap (_.var global)) - - _ - (/////.throw /////extension.incorrect-syntax name))) - -(def: (js//call name generate inputs) - Handler - (case inputs - (^ (list& functionS argsS+)) - (do /////.monad - [functionJS (generate functionS) - argsJS+ (monad.map @ generate argsS+)] - (wrap (_.apply/* functionJS argsJS+))) - - _ - (/////.throw /////extension.incorrect-syntax name))) - -(def: js - Bundle - (|> bundle.empty - (bundle.install "null" (nullary js//null)) - (bundle.install "undefined" (nullary js//undefined)) - (bundle.install "object" (nullary js//object)) - (bundle.install "array" (variadic _.array)) - (bundle.install "global" js//global) - (bundle.install "call" js//call))) - -(def: (object//new name generate inputs) - Handler - (case inputs - (^ (list& constructorS argsS+)) - (do /////.monad - [constructorJS (generate constructorS) - argsJS+ (monad.map @ generate argsS+)] - (wrap (_.new constructorJS argsJS+))) - - _ - (/////.throw /////extension.incorrect-syntax name))) - -(def: (object//call name generate inputs) - Handler - (case inputs - (^ (list& objectS methodS argsS+)) - (do /////.monad - [objectJS (generate objectS) - methodJS (generate methodS) - argsJS+ (monad.map @ generate argsS+)] - (wrap (|> objectJS - (_.at methodJS) - (_.do "apply" (list& objectJS argsJS+))))) - - _ - (/////.throw /////extension.incorrect-syntax name))) - -(def: (object//set [fieldJS valueJS objectJS]) - (Trinary Expression) - (///runtime.js//set objectJS fieldJS valueJS)) - -(def: object - Bundle - (<| (bundle.prefix "object") - (|> bundle.empty - (bundle.install "new" object//new) - (bundle.install "call" object//call) - (bundle.install "read" (binary (product.uncurry ///runtime.js//get))) - (bundle.install "write" (trinary object//set)) - (bundle.install "delete" (binary (product.uncurry ///runtime.js//delete))) - ))) - -(def: (array//write [indexJS valueJS arrayJS]) - (Trinary Expression) - (///runtime.array//write indexJS valueJS arrayJS)) - -(def: array - Bundle - (<| (bundle.prefix "array") - (|> bundle.empty - (bundle.install "read" (binary (product.uncurry ///runtime.array//read))) - (bundle.install "write" (trinary array//write)) - (bundle.install "delete" (binary (product.uncurry ///runtime.array//delete))) - (bundle.install "length" (unary (_.the "length"))) - ))) - -(def: #export bundle - Bundle - (<| (bundle.prefix "js") - (|> ..js - (dictionary.merge ..object) - (dictionary.merge ..array)))) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/extension.lux b/stdlib/source/lux/tool/compiler/phase/generation/lua/extension.lux index a40b4953f..3bc0a0887 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/lua/extension.lux +++ b/stdlib/source/lux/tool/compiler/phase/generation/lua/extension.lux @@ -6,10 +6,8 @@ [// [runtime (#+ Bundle)]] [/ - ["." common] - ["." host]]) + ["." common]]) (def: #export bundle Bundle - (|> common.bundle - (dictionary.merge host.bundle))) + common.bundle) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/lua/extension/host.lux b/stdlib/source/lux/tool/compiler/phase/generation/lua/extension/host.lux deleted file mode 100644 index 9c178e79c..000000000 --- a/stdlib/source/lux/tool/compiler/phase/generation/lua/extension/host.lux +++ /dev/null @@ -1,25 +0,0 @@ -(.module: - [lux #* - [abstract - ["." monad (#+ do)]] - [data - ["." product] - [collection - ["." dictionary]]] - [host - ["_" lua (#+ Expression)]]] - ["." /// #_ - ["#." runtime (#+ Handler Bundle)] - ["#/" // #_ - ["#." extension (#+ Nullary Unary Binary Trinary Variadic - nullary unary binary trinary variadic)] - ["#/" // - ["#." extension - ["." bundle]] - ["#/" // #_ - ["#." synthesis]]]]]) - -(def: #export bundle - Bundle - (<| (bundle.prefix "lua") - bundle.empty)) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/extension.lux b/stdlib/source/lux/tool/compiler/phase/generation/python/extension.lux index a40b4953f..3bc0a0887 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/python/extension.lux +++ b/stdlib/source/lux/tool/compiler/phase/generation/python/extension.lux @@ -6,10 +6,8 @@ [// [runtime (#+ Bundle)]] [/ - ["." common] - ["." host]]) + ["." common]]) (def: #export bundle Bundle - (|> common.bundle - (dictionary.merge host.bundle))) + common.bundle) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/python/extension/host.lux b/stdlib/source/lux/tool/compiler/phase/generation/python/extension/host.lux deleted file mode 100644 index 242022c87..000000000 --- a/stdlib/source/lux/tool/compiler/phase/generation/python/extension/host.lux +++ /dev/null @@ -1,25 +0,0 @@ -(.module: - [lux #* - [abstract - ["." monad (#+ do)]] - [data - ["." product] - [collection - ["." dictionary]]] - [host - ["_" python (#+ Expression)]]] - ["." /// #_ - ["#." runtime (#+ Handler Bundle)] - ["#/" // #_ - ["#." extension (#+ Nullary Unary Binary Trinary Variadic - nullary unary binary trinary variadic)] - ["#/" // - ["#." extension - ["." bundle]] - ["#/" // #_ - ["#." synthesis]]]]]) - -(def: #export bundle - Bundle - (<| (bundle.prefix "python") - bundle.empty)) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension.lux b/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension.lux index a40b4953f..3bc0a0887 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension.lux +++ b/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension.lux @@ -6,10 +6,8 @@ [// [runtime (#+ Bundle)]] [/ - ["." common] - ["." host]]) + ["." common]]) (def: #export bundle Bundle - (|> common.bundle - (dictionary.merge host.bundle))) + common.bundle) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension/host.lux b/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension/host.lux deleted file mode 100644 index c8b6dcb27..000000000 --- a/stdlib/source/lux/tool/compiler/phase/generation/ruby/extension/host.lux +++ /dev/null @@ -1,25 +0,0 @@ -(.module: - [lux #* - [abstract - ["." monad (#+ do)]] - [data - ["." product] - [collection - ["." dictionary]]] - [host - ["_" ruby (#+ Expression)]]] - ["." /// #_ - ["#." runtime (#+ Handler Bundle)] - ["#/" // #_ - ["#." extension (#+ Nullary Unary Binary Trinary Variadic - nullary unary binary trinary variadic)] - ["#/" // - ["#." extension - ["." bundle]] - ["#/" // #_ - ["#." synthesis]]]]]) - -(def: #export bundle - Bundle - (<| (bundle.prefix "ruby") - bundle.empty)) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension.jvm.lux b/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension.jvm.lux index a40b4953f..3bc0a0887 100644 --- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension.jvm.lux +++ b/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension.jvm.lux @@ -6,10 +6,8 @@ [// [runtime (#+ Bundle)]] [/ - ["." common] - ["." host]]) + ["." common]]) (def: #export bundle Bundle - (|> common.bundle - (dictionary.merge host.bundle))) + common.bundle) diff --git a/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension/host.jvm.lux b/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension/host.jvm.lux deleted file mode 100644 index b8b2b7612..000000000 --- a/stdlib/source/lux/tool/compiler/phase/generation/scheme/extension/host.jvm.lux +++ /dev/null @@ -1,11 +0,0 @@ -(.module: - [lux #*] - [/// - [runtime (#+ Bundle)] - [/// - [extension - ["." bundle]]]]) - -(def: #export bundle - Bundle - bundle.empty) diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 99276bcf1..08bc451b1 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -5,9 +5,7 @@ [case (#+)] [loop (#+)] [function (#+)] - [extension (#+) - [common (#+)] - [host (#+)]])] + [extension (#+)])] (.module: ["/" lux #* [abstract |