diff options
author | Eduardo Julian | 2018-05-16 01:46:19 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-05-16 01:46:19 -0400 |
commit | 6bbae1a36c351eaae4dc909714e7f3c7bfeaeca3 (patch) | |
tree | 9f6d14745affdb046dcce9c6dd10a7897322694f /new-luxc/source/luxc/lang/variable.lux | |
parent | 273c2d517dbafbe6df4d9b9ac65ffd4749e63642 (diff) |
- Migrated function analysis to stdlib.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/variable.lux | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/new-luxc/source/luxc/lang/variable.lux b/new-luxc/source/luxc/lang/variable.lux deleted file mode 100644 index b33574d19..000000000 --- a/new-luxc/source/luxc/lang/variable.lux +++ /dev/null @@ -1,47 +0,0 @@ -(.module: - lux - (lux (data (coll [list "list/" Functor<List>])))) - -(def: #export Variable Int) -(def: #export Register Nat) - -(def: #export (captured register) - (-> Register Variable) - (|> register n/inc nat-to-int (i/* -1))) - -(def: #export (local register) - (-> Register Variable) - (nat-to-int register)) - -(def: #export (local-register variable) - (-> Variable Register) - (int-to-nat variable)) - -(def: #export (captured-register variable) - (-> Variable Register) - (|> variable (i/* -1) int-to-nat n/dec)) - -(do-template [<name> <comp>] - [(def: #export (<name> var) - (-> Variable Bool) - (<comp> 0 var))] - - [self? i/=] - [local? i/>] - [captured? i/<] - ) - -(def: #export (from-ref ref) - (-> Ref Variable) - (case ref - (#.Local register) - (local register) - - (#.Captured register) - (captured register))) - -(def: #export (environment scope) - (-> Scope (List Variable)) - (|> scope - (get@ [#.captured #.mappings]) - (list/map (function (_ [_ [_ ref]]) (from-ref ref))))) |