------art_4127_17562134.1211663195286
Content-Type: multipart/alternative; 
	boundary---art_4128_20829610.1211663195287"

------art_4128_20829610.1211663195287
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Fri, May 23, 2008 at 7:18 AM, ts <decoux / moulon.inra.fr> wrote:

> Eric Mahurin wrote:
> > Is there any reason this idea couldn't be applied to head?
>
>  Try it on your personal version.
>
> Guy Decoux


Here is a patch for handling optional args for blocks using this simple idea
- use a "primary_value" instead of "arg_value" for the default values.  I
simply did some cutting and pasting for the argument definitions for "def"
and changed "arg_value" to "primary_value".  It worked on the first try!
Spent more time writing tests (included) than adding the new functionality.

Matz, any chance this could be integrated for a trial period at least?  It
shouldn't cause any compatibility issues.

------art_4128_20829610.1211663195287
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Fri, May 23, 2008 at 7:18 AM, ts &lt;<a hrefailto:decoux / moulon.inra.fr">decoux / moulon.inra.fr</a>&gt; wrote:<br><div classmail_quote"><blockquote classmail_quote" styleorder-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div classh2E3d">Eric Mahurin wrote:<br>
&gt; Is there any reason this idea couldn&#39;t be applied to head?<br>
<br>
</div>&nbsp;Try it on your personal version.<br>
<br>
Guy Decoux</blockquote><div><br>Here is a patch for handling optional args for blocks using this simple idea - use a &quot;primary_value&quot; instead of &quot;arg_value&quot; for the default values.&nbsp; I simply did some cutting and pasting for the argument definitions for &quot;def&quot; and changed &quot;arg_value&quot; to &quot;primary_value&quot;.&nbsp; It worked on the first try!&nbsp; Spent more time writing tests (included) than adding the new functionality.<br>
<br>Matz, any chance this could be integrated for a trial period at least?&nbsp; It shouldn&#39;t cause any compatibility issues.<br><br></div></div>

------art_4128_20829610.1211663195287--

------art_4127_17562134.1211663195286
Content-Type: text/x-diff; name=block_optarg.patch
Content-Transfer-Encoding: base64
X-Attachment-Id: f_fgmop6rj0
Content-Disposition: attachment; filename=block_optarg.patch

SW5kZXg6IHNhbXBsZS90ZXN0LnJiCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHNhbXBsZS90ZXN0LnJiCShyZXZp
c2lvbiAxNjU2OCkKKysrIHNhbXBsZS90ZXN0LnJiCSh3b3JraW5nIGNvcHkpCkBAIC0yOTYsNiAr
Mjk2LDY0IEBACiB0ZXN0X29rKGYuY2FsbChbNDIsNTVdKSA9PSBbWzQyLDU1XV0pCiB0ZXN0X29r
KGYuY2FsbCg0Miw1NSkgPT0gWzQyLDU1XSkKIAorZiA9IGxhbWJkYSB7IHxhLCBiPTQyLCAqY3wg
W2EsYixjXSB9Cit0ZXN0X29rKGYuY2FsbCgxICAgICAgKSA9PSBbMSw0MixbICBdXSApCit0ZXN0
X29rKGYuY2FsbCgxLDQzICAgKSA9PSBbMSw0MyxbICBdXSApCit0ZXN0X29rKGYuY2FsbCgxLDQz
LDQ0KSA9PSBbMSw0MyxbNDRdXSApCisKK2YgPSBsYW1iZGEgeyB8YSwgYj0oYXwxNiksICpjLCAm
YmxvY2t8IFthLGIsYyxibG9jayYmYmxvY2tbXV0gfQordGVzdF9vayhmLmNhbGwoOCAgICAgICkg
ICAgID09IFs4LDI0LFsgIF0sbmlsXSApCit0ZXN0X29rKGYuY2FsbCg4LDQzICAgKSAgICAgPT0g
WzgsNDMsWyAgXSxuaWxdICkKK3Rlc3Rfb2soZi5jYWxsKDgsNDMsNDQpICAgICA9PSBbOCw0Myxb
NDRdLG5pbF0gKQordGVzdF9vayhmLmNhbGwoOCAgICAgICl7NDV9ID09IFs4LDI0LFsgIF0sNDUg
XSApCit0ZXN0X29rKGYuY2FsbCg4LDQzICAgKXs0NX0gPT0gWzgsNDMsWyAgXSw0NSBdICkKK3Rl
c3Rfb2soZi5jYWxsKDgsNDMsNDQpezQ1fSA9PSBbOCw0MyxbNDRdLDQ1I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BmX2Jsb2NrX29wdAorCQkgICAgeworCQkgICAgLyol
JSUqLworCQkJTk9ERSAqb3B0cyA9ICQxOworCisJCQl3aGlsZSAob3B0cy0+bmRfbmV4dCkgewor
CQkJICAgIG9wdHMgPSBvcHRzLT5uZF9uZXh0OworCQkJfQorCQkJb3B0cy0+bmRfbmV4dCA9ICQz
OworCQkJJCQgPSAkMTsKKwkJICAgIC8qJQorCQkJJCQgPSByYl9hcnlfcHVzaCgkMSwgJDMpOwor
CQkgICAgJSovCisJCSAgICB9CisJCTsKKwogZl9vcHRhcmcJOiBmX29wdAogCQkgICAgewogCQkg
ICAgLyolJSUqLwo------art_4127_17562134.1211663195286--