<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span><br></span></div><div><br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font face="Arial" size="2"><b><span style="font-weight:bold;">&gt;From:</span></b> Miller Puckette &lt;msp@ucsd.edu&gt;<br> <b><span style="font-weight: bold;"></span></b></font><font face="Arial" size="2"><b><span style="font-weight: bold;">&gt;To:</span></b> Jonathan Wilkes &lt;jancsika@yahoo.com&gt; <br><b><span style="font-weight: bold;"></span></b></font><font face="Arial" size="2"><b><span style="font-weight: bold;">&gt;Cc:</span></b> pd-dev@iem.at <br> <b><span style="font-weight: bold;"></span></b></font><font face="Arial" size="2"><b><span style="font-weight: bold;">&gt;Sent:</span></b> Sunday, June
 16, 2013 12:53 PM<br> <b><span style="font-weight: bold;"></span></b></font><font face="Arial" size="2"><b><span style="font-weight: bold;">&gt;Subject:</span></b> Re: [PD-dev] Message dispatching system<br> </font> </div> <div class="y_msg_container"><br>&gt;It's a general rule - it was the easiest way to code it portably.&nbsp; If you<br>wanted to truly intersperse floats and integer/pointers you'd have something<br>like a 32-case switch statement to generate the function calls.<br><br>I understand that part of the design.&nbsp; But the other general rule is that<br>the order of args one specifies in the class_addmethod definition fits the<br>order of args as they appear in the c function definition.&nbsp; That's why I asked<br>specifically about graph_array and why it does not follow this general rule.<br><br>Both general rules are sensible IMO.<br><br>-Jonathan<br><br>cheers<br>Miller<br><br>On Mon, May 20, 2013 at 01:41:06PM -0400, Jonathan Wilkes
 wrote:<br>&gt; Hi list,<br>&gt;&nbsp; &nbsp; &nbsp; I learned some more about Pd's message dispatching system while<br>&gt; adding jump-on-click mouse clicks and bar graphs to "Put" menu<br>&gt; arrays:<br>&gt; <br>&gt; 1) For type-checked args in class_addmethod, you can specify them in<br>&gt; any order.<br>&gt; 2) Pd re-arranges them, putting the symbol/pointer args first and<br>&gt; the float args last.<br>&gt; 3) In the function for the method you have to specify the args in<br>&gt; the order from #2.<br>&gt; <br>&gt; I see graph_array makes use of these in g_graph.c: the args are<br>&gt; symbol float symbol float float, but the function receives the<br>&gt; symbols as the first two args.<br>&gt; <br>&gt; Was this done to fix a bug or keep something backwards compatible?<br>&gt; Are there other methods done this way?&nbsp; In general I think it's much<br>&gt; better to specify type-checked args in the same order they'll be<br>&gt; received by the
 function, meaning symbols/pointers then floats.<br>&gt; Otherwise it makes it more difficult to track down errors.<br>&gt; <br>&gt; -Jonathan<br>&gt; <br>&gt; _______________________________________________<br>&gt; Pd-dev mailing list<br>&gt; <a href="" ymailto="mailto:Pd-dev@iem.at">Pd-dev@iem.at</a><br>&gt; <a href="" target="_blank">http://lists.puredata.info/listinfo/pd-dev</a><br><br><br></div> </div> </div>  </div></body></html>