[PD-dev] post/verbose code

Hans-Christoph Steiner hans at at.or.at
Wed Mar 17 21:48:02 CET 2010


On Mar 16, 2010, at 5:20 AM, IOhannes m zmoelnig wrote:

> On 2010-01-22 22:04, Miller Puckette wrote:
>> Hi all,
>>
>> As I understand it... post() puts out an entire line, and  
>> startpost(),
>> any number of "poststring", etc, and then an endpost() also puts out
>> one line.  The only ugly thing is that some old code uses  
>> "poststring"
>> (etc) to APPEND text to a post().
>>
>> I think it would be compatible with existing code to make "post"  
>> supply
>> a newline at the end of teh message, to have "startpost()" be a  
>> post()
>> but without the newline, and endpost() only put out the newline.  The
>> only trick would be (for compatibility) that if a post() is followed
>> by one or more poststring() calls, one should insert the poststring()
>> text before the newline that was written by post(), e.g.:
>>
>> post("foo")
>>
>> --> foo\n
>>
>> poststring("bar")
>>
>> ---> foo bar\n
>
> hmm, as a matter of fact, i just tried this, and it doesn't seem to be
> true anyhow:
>
> <code>
>  endpost();
>  post("foo");
>  poststring("bar");
>  endpost();
>  post("bla");
> </code>
>
> results in
> <output>
> foo
> bar
> bla
> </output>
> that is "foo\n bar\nbla"
>
> i also did a not-so-quick grep over all the externals in the puredata
> svn, and found that poststring() is only used 3 times in total,  
> twice in
> cyclone (where it is only used in startpost()->poststring()->endpost()
> constructs), and once in zexy (where i have put plenty of manual  
> "\n" in
> the strings to be printed).
>
> i don't hink that compatibility in printout is _very_ important, and
> since it doesn't seem to work anyhow as expected, i guess it is a good
> chance to remove cruft.


Makes sense to me.  Sounds like it should be fixed to be right, rather  
than maintaining backwards compatibility.

.hc


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

If nature has made any one thing less susceptible than all others of  
exclusive property, it is the action of the thinking power called an  
idea, which an individual may exclusively possess as long as he keeps  
it to himself; but the moment it is divulged, it forces itself into  
the possession of everyone, and the receiver cannot dispossess himself  
of it.            - Thomas Jefferson






More information about the Pd-dev mailing list