From 1bc64babd1405bfa70567d576cdef3e45b508b95 Mon Sep 17 00:00:00 2001 From: Drahflow Date: Wed, 26 Mar 2014 00:48:47 +0100 Subject: Container types --- compiler/standardClient.ey | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'compiler') diff --git a/compiler/standardClient.ey b/compiler/standardClient.ey index d807533..36f8472 100644 --- a/compiler/standardClient.ey +++ b/compiler/standardClient.ey @@ -644,7 +644,11 @@ # Run from right (stacktop) argument to left (stacklow) argument: # Take topmost type, check whether it can be found in other stacks (from top) # Eliminate all matching types via function or loop creation - { _ ==f sys .typed .inputs ==inputs + { _ ==f _ sys .typed .inputs ==inputs + sys .typed .outputs ==outputs + + outputs len 1 gt { "multi-output function in auto-loop" die } rep + [ ] ==concreteArgs [ ] ==viewPortOffset @@ -795,7 +799,7 @@ [ loops _ len dearray ==loopIndex ] =loops loopIndex 0 ge { loopIndex concreteArgs * ==loopedOver - loopedOver cloneForLoop ==results + outputs len { loopedOver cloneForLoop } { [ ] } ? * ==results loopedOver getLoopStart ==i { i loopedOver isLoopEnd not } { [ concreteArgs _ len dearray ] ==concreteArgsCopy @@ -805,7 +809,7 @@ } each concreteArgsCopy stageCalls argTypes loops unravel - i loopedOver transformLoopIndex results =[] + outputs len { i loopedOver transformLoopIndex results =[] } rep # results dump # TODO: think about a single function returning multiple values # should be solved by producing two arrays side by side @@ -813,7 +817,7 @@ i loopedOver doLoopStep =i } loop - results + outputs len { results } rep # push @$data, [\@results, ['array', '[]', [['range', 0, $#results]], [undef]]]; # FIXME the undef can be determined } { -- cgit v1.2.3