I have recently translated a Pd algo into an expr~ algo, and expr failed to be as efficient, or I failed (to translate it into sthg efficient). But, in general and for practical purposes, there's no difference between the two types.
So don't worry about efficiency.
I think that the most important thing is that the patch ends up being easy to understand. You can put everything into a formula and, more or less, the efficiency will probably be the same. But if you put everything into a single formula, then that formula becomes criptic, and difficult to change, or replace.
Combining Pd core math objects and expr family objects sems to be a good strategy. Part of being intelligent, is being able to create chunks of meaningful info. So a well designed patch should allow you to identify those chunks easily. You'll notice that a patch becomes easier to read if you combine both types.
Your question is relevant. However, there are other issues which are far more relevant than efficiency.
- 1st example, Pd built-in [/] operator:
[25 24(
|
[/]
|
[1.041)
[25 24(
|
[expr $f1/$f2]
|
[1.041)
[bang(
|
[expr 25/24]
|
[1 )
[bang(
|
[expr 25./24] (notice the decimal point after the 25)
|
[1 .041)
And don't think that Pd and expr share the same philosophy as regards 0^0. (LOL^LOL).
[0 0(
|
[pow]
|
[0 )
[0 0(
|
[expr pow($1, $2)]
|
[1 )
Cordially, Landon
I live and love in Argentina