Greetings,
I would personally find it useful if it was possible to use named variables
as arguments to arithmetic operators etc (particularly [expr]. It seems to
me this could aid readability in certain cases greatly, and also save time
in programming - rather than having to wire up [recieve]s or [t f
b]->[value] pairs (if you follow), one could simply enter the name of the
variable directly into the expression where appropriate. The object would
follow the convention to output the result when a message was recieved at
the left inlet, with the appropriate value(s) substituted. Of course, it
would have to support substitution of $ arguments in the variable names as
well, but I imagine that would happen quite naturally if it was implemented.
In the cases where the argument is competing with a cold inlet, I suppose it
might be argued that it could be confusing. Even if that was a confusion,
it would be easily avoided.
I might have a go at making a modified [expr], but that won't happen very
quickly as I've not written a pd external (or very much c) before, and, of
course, it's not exactly stopping me from working. I definitely feel it
would be a worthy addition to the language, though. It would be nice if it
was deeply integrated enough that it would be automatically applied to any
object that takes a float as an argument as well. I don't know if that is
realistic, both in terms of at which point in the program or external text
parsing is implemented, and in the nature of some objects really relying on
the argument being used for initialisation, and not varied beyond that.
While I'm on this stream of consciousnes, perhaps even that could be a
feature - changing the value causing the object to essentially be
reconstructed. One would need to be aware of this, and duly cautious, or it
could really choke things up, but that is just the nature of the game we
call programming.
I'd be interested what anyone elses thoughts are on this.
Peter