[PD] constants

Charles Henry czhenry at gmail.com
Thu Feb 16 17:46:12 CET 2012


> On 2012-02-15 16:11, Jonathan Wilkes wrote:
>>
>> Let's go back:
>>
>> Instead of time units, let's take the incoming single-selector "pi" and
>> replace it with
>> the float value of pi for any object that doesn't have a "pi" method or an
>> "anything" method (but does have a float method).  Furthermore, if a class
>> defines a
>> float argument but the argument provided isn't a float, then check first
>> if what it received
>> was A_SYMBOL 'pi' and if so replace with the float value of pi.
>>
>> Is what I wrote above possible to do without causing huge problems to
>> performance or
>> creating ambiguities?  Is it something people would look at as a feature,
>> or a nuisance that
>> makes it harder to learn Pd?  If the answer is that something like this
>> constant expansion
>> is a bad idea then there's no point discussing macro expansion for time
>> units.
>>
>> -Jonathan

You could easily add a creator function for [pi] which becomes a float
with initial value 3.14--and add a method to [f] for the message [ pi
(

Still a little cumbersome to use because this doesn't get replacement
in messages, arguments or anywhere else--but consistent with patching
styles for symbols/floats.



More information about the Pd-list mailing list