uliss / pd-ceammc

Pure Data CEAMMC distribution (based on vanilla 0.53 by Miller Puckette)
Other
107 stars 6 forks source link

"value" function in argument expansion #195

Open 60-hz opened 9 months ago

60-hz commented 9 months ago

expr function in argument expansion does not support "value" function. It would be very handy if it could:

Capture d’écran 2023-09-16 à 22 16 37
[ceammc] epxr() error: Unexpected token "val" found at position 0. in expression 'val '
[math.sync_add] [data] parse failed
uliss commented 8 months ago

Try to describe problems can appear with such realization.

[math.+] (and other ceammc objects) do function this call during initialization process, after creation at loadbang stage. So it called only once, and technically objects like math.+ even didn't know that there was some argument expansion step, they just get arguments. For example [data.list sort(3 1 2)] actually just gets arguments: 1 2 3.

If we will have value() object init function, there can be situation that value myVal will be created after the math.+' so latest one will not get right value. This problem will be especially tricky to debug, because Pd object creation order can be changed without notification, if you delete first object, then Undo: creation order will change.

If you have some thoughts about it, please write. May be we can realize per-canvas constant loading, which will be done before the patch loads etc.