Hi Yann,
On 07/17, Yann Orlarey wrote:
>
> I'm not sure that answers your question,
No it doesn't ;) probably I wasn't clear, please see below.
> but you can do that, for instance:
of course, you can always rewrite dsBus2int or anything else, but what
if you do not want to change the "wants-the-list" function?
Let me provide a stupid/artificial but simple example. Suppose you have
tsum((x, xs)) = tan(x) + tsum(xs);
tsum(x) = tan(x);
Now,
process = si.bus(4) : tsum;
obviously won't work.
process = tsum(si.bus(4));
works, but only because "tsum" is simple enough. Lets complicate it:
tsum((x, xs)) = sin(x)/cos(x) + tsum(xs);
tsum(x) = sin(x)/cos(x);
after this change
process = tsum(si.bus(4));
no longer works as expected, it has 4*2 inputs. You have to do
process(x1,x2,x3,x4) = tsum((x1,x2,x3,x4));
or
process = \(x1,x2,x3,x4).(tsum((x1,x2,x3,x4)));
but this is very inconvenient and doesn't allow to specify the number
of inputs.
The best solution I was able to find is something like this:
apply(1, op) = \(x1). (op((x1)));
apply(2, op) = \(x1,x2). (op((x1,x2)));
apply(3, op) = \(x1,x2,x3). (op((x1,x2,x3)));
apply(4, op) = \(x1,x2,x3,x4). (op((x1,x2,x3,x4)));
apply(5, op) = \(x1,x2,x3,x4,x5). (op((x1,x2,x3,x4,x5)));
...
apply(32,op) = ...;
this allows to do
process = apply(N, tsum);
as long as N is constant and <= 32. But this is not nice, and I do not
know how can I define apply(n, op) for any "n".
Oleg.
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users