diff options
| author | Drahflow <drahflow@gmx.de> | 2014-03-11 19:41:09 +0100 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2014-03-11 19:41:09 +0100 |
| commit | b4d11704aa33ec6d471479e60be0fdaade5d9b7d (patch) | |
| tree | 07e1c5e0c43b8d3421f14c0adea77c769d6ccdfd /compiler | |
| parent | 322d8de9f2d5a4b7159c72d36add03e29dcbe5c2 (diff) | |
Complex data types can now be done
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/standardClient.ey | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/compiler/standardClient.ey b/compiler/standardClient.ey index cdf2f6f..4409100 100644 --- a/compiler/standardClient.ey +++ b/compiler/standardClient.ey @@ -527,6 +527,15 @@ invalid # function type { [ + { object "#dom" .? } { + object "#dom" . ==d + object "#in" . ==in + in len 1 neq { "multi-input scope (with #dom) in typeStack" die } rep + [ 0 in * 0 d len 1 sub ] + object "#out" . ==out + out len 1 neq { "multi-output scope (with #dom) in typeStack" die } rep + 0 out * typeStackInternal + } { object "#*" .? } { object "#in" . ==in in len 1 neq { "multi-input scope in typeStack" die } rep @@ -601,15 +610,23 @@ } /commonIterationType deff { ==arr - 0 + arr sys .typed .type 7 eq { [ arr _ len dearray ] } { arr "#iclone" . } ? * + } /cloneForLoop deff + + { ==arr ==i + arr sys .typed .type 7 eq { i } { i arr "#itrans" . } ? * + } /transformLoopIndex deff + + { ==arr + arr sys .typed .type 7 eq { 0 } { arr "#istart" . } ? * } /getLoopStart deff { ==arr - arr len eq + arr sys .typed .type 7 eq { arr len eq } { arr "#iend" . } ? * } /isLoopEnd deff { ==arr - 1 add + arr sys .typed .type 7 eq { 1 add } { arr "#istep" . } ? * } /doLoopStep deff # Executing a function f: A->B->C (i.e. B A f) on concrete arguments b a. @@ -751,18 +768,18 @@ [ argTypes _ len dearray ==argType ] =argTypes [ loops _ len dearray ==loopIndex ] =loops loopIndex 0 ge { - [ ] ==results loopIndex concreteArgs * ==loopedOver + loopedOver cloneForLoop ==results loopedOver getLoopStart ==i { i loopedOver isLoopEnd not } { [ concreteArgs _ len dearray ] ==concreteArgsCopy stage { ==j # TODO: think about a single function returning multiple values - i j concreteArgs * * j concreteArgsCopy =[] + i loopedOver transformLoopIndex j concreteArgs * * j concreteArgsCopy =[] } each - [ concreteArgsCopy stageCalls argTypes loops unravel ] - results -01 cat =results + concreteArgsCopy stageCalls argTypes loops unravel + i loopedOver transformLoopIndex results =[] # results dump # TODO: think about a single function returning multiple values # should be solved by producing two arrays side by side |
