diff options
author | Eduardo Julian | 2022-08-11 04:15:07 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-08-11 04:15:07 -0400 |
commit | 065e8a4d8122d4616b570496915d2c0e2c78cd6b (patch) | |
tree | f2bbdc3e40b796b34026ab04c9a478d8a3f082d5 /stdlib/source/library/lux/ffi.lux | |
parent | 68d78235694c633c956bb9e8a007cad7d65370bc (diff) |
Re-named the "case" macro to "when".
Diffstat (limited to 'stdlib/source/library/lux/ffi.lux')
-rw-r--r-- | stdlib/source/library/lux/ffi.lux | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/stdlib/source/library/lux/ffi.lux b/stdlib/source/library/lux/ffi.lux index 92c342750..850ac3b83 100644 --- a/stdlib/source/library/lux/ffi.lux +++ b/stdlib/source/library/lux/ffi.lux @@ -277,7 +277,7 @@ (def (host_optional it) (-> Optional Code) (.if (.the #optional? it) - (` (.case (, (the #mandatory it)) + (` (.when (, (the #mandatory it)) {.#Some (, g!it')} (, g!it') @@ -371,13 +371,13 @@ :parameters: (the #parameters input) g!parameters (..parameters :parameters:) :output: (the [#anonymous #output] it) - :input:/* (case :parameters: + :input:/* (when :parameters: {.#End} (list (` [])) parameters (list#each ..output_type :parameters:))] - (` (.def ((, g!it) (,* (case g!parameters + (` (.def ((, g!it) (,* (when g!parameters {.#End} (list g!it) _ (list#each (the #mandatory) g!parameters)))) (.All ((, g!it) (,* g!variables)) @@ -407,7 +407,7 @@ (for @.js (these) (def (imported class) (-> Text Code) - (case (text.all_split_by .module_separator class) + (when (text.all_split_by .module_separator class) {.#Item head tail} (list#mix (.function (_ sub super) (` (<get> (, (code.text sub)) @@ -449,7 +449,7 @@ g!class_variables (list#each code.local class_parameters) g!class (` ((, (code.local (maybe.else class_name alias))) (,* g!class_variables))) :output: [#optional? false #mandatory g!class]] - (` (.def ((, g!it) (,* (case g!parameters + (` (.def ((, g!it) (,* (when g!parameters {.#End} (list g!it) _ (list#each (the #mandatory) g!parameters)))) (.All ((, g!it) (,* g!class_variables) (,* g!input_variables)) @@ -564,13 +564,13 @@ (syntax (_ [host_module (<>.maybe <code>.text) it ..importP]) (let [host_module_import! (is (List Code) - (case host_module + (when host_module {.#Some host_module} (list (` (<import> (, (code.text host_module))))) {.#None} (list)))] - (case it + (when it {#Global it} (in (list (..global_definition host_module_import! it))) @@ -591,7 +591,7 @@ (..Object (.Primitive (, (code.text (..host_path class_name))) [(,* g!class_variables)])))) (list#each (.function (_ member) - (`` (`` (case member + (`` (`` (when member (,, (for @.lua (,, (these)) @.ruby (,, (these)) (,, (these {#Constructor it} @@ -631,10 +631,10 @@ [head tail] (<code>.tuple (<>.and <code>.local (<>.some <code>.local)))]) (with_symbols [g!_] (let [global (` ("js constant" (, (code.text head))))] - (case tail + (when tail {.#End} (in (list (` (is (.Maybe (, type)) - (case (..type_of (, global)) + (when (..type_of (, global)) "undefined" {.#None} @@ -644,7 +644,7 @@ {.#Item [next tail]} (let [separator "."] (in (list (` (is (.Maybe (, type)) - (case (..type_of (, global)) + (when (..type_of (, global)) "undefined" {.#None} @@ -654,7 +654,7 @@ (def !defined? (template (_ <global>) - [(.case (..global Any <global>) + [(.when (..global Any <global>) {.#None} .false @@ -706,7 +706,7 @@ (.function (_ name phase archive inputs) (.function (_ state) (let [<bindings> [name phase archive state]] - (case (<code>.result <parser> inputs) + (when (<code>.result <parser> inputs) {try.#Failure error} {try.#Failure (%.format "Invalid inputs for extension: " (%.text name) text.\n error)} @@ -720,7 +720,7 @@ (.function (_ name phase archive inputs) (.function (_ state) (let [<bindings> [name phase archive state]] - (case inputs + (when inputs <inputs> <body> @@ -780,7 +780,7 @@ (def (pairs it) (All (_ a) (-> (List a) (List [a a]))) - (case it + (when it (list.partial left right tail) (list.partial [left right] (pairs tail)) @@ -796,7 +796,7 @@ (do [! try.monad] [[state output] (monad.mix ! (.function (_ [key value] [state output]) - (case key + (when key (text_synthesis key) (do try.monad [[state value] (phase archive value state)] |