Closed toelli-msft closed 3 years ago
What's the right solution? Maybe to not unpack tuple arguments of
lam
s?
Hmm, no that doesn't work, because build
takes a lam
and does the unpacking of the tuple itself. Implementing my suggestion will break build
. I suppose we have two options
build
to be compatible with itmap
to unpack a tuple argument to the mapped function.map
(or suffwdpass_map
) and generate special code that doesn't unpack its argument tuple.2 is probably less invasive than 1 but I may need a C++ expert. 3 is least invasive but most special-cased.
Consider the following functio
ksc currently generates C++ like
Because of our Cgen special rules that automatically unpack functions of tuple arguments the
lam
is compiled toauto c$0 = [=](ks::allocator * $alloc, double targ1, double targ2)
which has too many arguments! Oops.What's the right solution? Maybe to not unpack tuple arguments of
lam
s? I think that is OK since I think thatlam
s anddef
s are not actually interchangable. Needs more thought/discussion.