Hi Oleg,

Let me explain why there is a sequential composition error in your last
example.

this works and this is clear (now). But,
>
>         s(x,y) = x + y; // same as s = \(x,y).(x + y);
>         process = s(1,!,3);
>
> leads to "ERROR in sequential composition A:B".
>
> Again, it is not that I think this is wrong, but still.


 I will do all the rewritings, step by step:

   - s(1,!,3)
   - \(x,y).(x + y)(1,!,3)
   - \(y).(1 + y)(!,3)
   - (1+!)(3)
   - (1,! : +)(3)
   - 3 : 1,! : +

as we can see 1,!:+ is not correct, with a sequential composition error.

Cheers

Yann

Le sam. 1 avr. 2023 à 20:31, Oleg Nesterov <o...@redhat.com> a écrit :

> Hi Yann,
>
> On 04/01, yann orlarey wrote:
> >
> > Right, it is not a bug. The general rule for partial application is the
> > following :
> >
> >    - Assuming F is not an abstraction and has n+m inputs and A has n
> >    outputs, then we have the rewriting rule F(A) ==> A,bus(m):F (with
> bus(1) =
> >    _ and bus(n+1) = _,bus(n))
> >    - There is an exception when F is a binary operation like +,-,/,*. In
> >    this case, the rewriting rule is /(3) ==> _,3:/. In other words, when
> we
> >    apply only one argument, it is the second one.
>
> Well... Yes, thanks Yann, but this is clear.
>
> What was not clear to me is that "!" can automagically remove itself from
> the
> arglist.
>
> And even if I think I understand whats going on now, the fact that
>
>         process(x,y) = atan2(!,!,!, x, !,!,!, y, !,!,!);
>
> is the valid faust code still amazes me ;)
>
> And. To be honest, I still don't think this logic (syntax) is 100%
> consistent.
> If sin(0:!) or sin(!) is OK, then why is "process = sin()" the syntax
> error?
>
> Or. Why this doesn't logic work with lambdas ???
>
> Consider
>
>         s = +;
>         process = s(1,!,3);
>
> this works and this is clear (now). But,
>
>         s(x,y) = x + y; // same as s = \(x,y).(x + y);
>         process = s(1,!,3);
>
> leads to "ERROR in sequential composition A:B".
>
> Again, it is not that I think this is wrong, but still.
>
> Oleg.
>
>
_______________________________________________
Faudiostream-devel mailing list
Faudiostream-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-devel

Reply via email to