[PD-dev] string type for pd

Hans-Christoph Steiner hans at eds.org
Mon Feb 5 15:47:38 CET 2007


On Feb 3, 2007, at 6:40 PM, Martin Peach wrote:

> Bryan Jurish wrote:
>> morning Martin, morning list,
>>
>> just a note: I've patched the pd-0.40-2 source & re-compiled here
>> (separate build, not related to my flext problems mentioned in  
>> another
>> thread;-)), and I'm still triggering the #error at line 11 of str.c
>> (apparently induced because !defined(t_string)), despite the fact  
>> that
>> my (patched) m_pd.h (which is being properly (#include)d does in fact
>> include the relevant typedef.
>>
>>
> Yes, I threw that in at the last moment without really _testing_  
> it. I can see now that it wouldn't work although it seemed to at  
> the time...
> It would probably be better to #define PD_STRING_VERSION or  
> something similar in m_pd.h.
>> I'm running gcc-4.1.2 on debian-unstable/x86, and it seems that here,
>> "typedef...t_string" does *not* in fact #define t_string in the
>> preprocessor sense (a small test program confirms this).  [str]  
>> builds
>> fine if I comment out the #ifndef...#endif, but I hereby humbly  
>> suggest
>> finding a better method to test for pd-internal string support  
>> (either a
>> "real" preprocessor macro defined with #define in the patched  
>> m_pd.h or
>> an autoconf-style test compile, which is probably way overboard,  
>> but at
>> least wouldn't require a new patch)...
>>
>> at any rate, a thousand thanks for your work, and I'm looking  
>> forward to
>> playing with real strings in pd!
>>
>>
> Good to know I've done something useful for once!
> I guess my question now is whether it's best to have a single [str]  
> object with lots of selectors for different functions a la [list]  
> as I did in str.c, or a bunch of objects like [str_join]  
> [str_split] all in a str library, or individual objects in  
> "flatspace".

I think these should be in their own library called "string", then  
each of the objects would in individual objects in that library:  
[string/join], [string/split], etc.  "flatspace" is not the place for  
it, that's for backwards compatibility.  I think that the syntax of  
[list] is inconsistent without adding anything useful.  Everywhere  
else in the core of Pd, the object class is always is the first name,  
and the rest are arguments.

.hc

>
> Martin
>
>> marmosets,
>> 	Bryan
>>
>> On 2007-01-27 17:53:19, Martin Peach <martin.peach at sympatico.ca>  
>> appears
>> to have written:
>>
>>> I have implemented a string type for Pure Data as well as a [str]
>>> object that uses it.
>>>
>> [snip]
>>
>>
>
>
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://lists.puredata.info/listinfo/pd-dev


------------------------------------------------------------------------

Computer science is no more related to the computer than astronomy is  
related to the telescope.      -Edsger Dykstra






More information about the Pd-dev mailing list