<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:D="DAV:" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:547227783;
        mso-list-type:hybrid;
        mso-list-template-ids:-640095378 517608596 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-number-format:alpha-lower;
        mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:.75in;
        text-indent:-.25in;}
@list l1
        {mso-list-id:613445740;
        mso-list-type:hybrid;
        mso-list-template-ids:-910914612 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l2
        {mso-list-id:1146315122;
        mso-list-type:hybrid;
        mso-list-template-ids:-2039566834 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l2:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3
        {mso-list-id:1862667742;
        mso-list-type:hybrid;
        mso-list-template-ids:1696267666 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l3:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:1.0in;
        text-indent:-.25in;
        font-family:Symbol;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p style='margin-left:.5in;text-indent:-.25in;mso-list:l2 level1 lfo2'><![if !supportLists]><span
style='mso-list:Ignore'>1)<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]>Change the signatures to:<o:p></o:p></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<span
style='color:#2B91AF'>RubyMethodAttribute</span>(<span style='color:#A31515'>&quot;scan&quot;</span>,
<span style='color:#2B91AF'>RubyMethodAttributes</span>.PublicInstance)]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:blue'>public</span> <span style='color:blue'>static</span> <span
style='color:#2B91AF'>List</span>&lt;<span style='color:blue'>object</span>&gt;<span
style='color:green'>/*!*/</span> Scan(<span style='color:#2B91AF'>MutableString</span><span
style='color:green'>/*!*/</span> self, [<span style='color:#2B91AF'>NotNull</span>]<span
style='color:#2B91AF'>MutableString</span><span style='color:green'>/*!*/</span>
searchStr)<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [<span
style='color:#2B91AF'>RubyMethodAttribute</span>(<span style='color:#A31515'>&quot;scan&quot;</span>,
<span style='color:#2B91AF'>RubyMethodAttributes</span>.PublicInstance)]<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:blue'>public</span> <span style='color:blue'>static</span> <span
style='color:blue'>object</span> Scan(<span style='color:#2B91AF'>CodeContext</span><span
style='color:green'>/*!*/</span> context, <span style='color:#2B91AF'>MutableString</span><span
style='color:green'>/*!*/</span> self, [<span style='color:#2B91AF'>NotNull</span>]<span
style='color:#2B91AF'>BlockParam</span><span style='color:green'>/*!*/</span>
block, [<span style='color:#2B91AF'>NotNull</span>]<span style='color:#2B91AF'>MutableString</span><span
style='color:green'>/*!*/</span> searchStr)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoListParagraph style='margin-left:.75in;text-indent:-.25in;
mso-list:l0 level1 lfo4'><![if !supportLists]><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>a)<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Block
is a special parameter and it must follow self parameter. The order of parameters
is: <o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:1.0in;text-indent:-.25in;
mso-list:l3 level1 lfo3'><![if !supportLists]><span style='font-size:11.0pt;
font-family:Symbol;color:#1F497D'><span style='mso-list:Ignore'>&middot;<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>context<o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:1.0in;text-indent:-.25in;
mso-list:l3 level1 lfo3'><![if !supportLists]><span style='font-size:11.0pt;
font-family:Symbol;color:#1F497D'><span style='mso-list:Ignore'>&middot;<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>self <o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:1.0in;text-indent:-.25in;
mso-list:l3 level1 lfo3'><![if !supportLists]><span style='font-size:11.0pt;
font-family:Symbol;color:#1F497D'><span style='mso-list:Ignore'>&middot;<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>block<o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:1.0in;text-indent:-.25in;
mso-list:l3 level1 lfo3'><![if !supportLists]><span style='font-size:11.0pt;
font-family:Symbol;color:#1F497D'><span style='mso-list:Ignore'>&middot;<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>mandatory parameters<o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:1.0in;text-indent:-.25in;
mso-list:l3 level1 lfo3'><![if !supportLists]><span style='font-size:11.0pt;
font-family:Symbol;color:#1F497D'><span style='mso-list:Ignore'>&middot;<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>optional parameters<o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:1.0in;text-indent:-.25in;
mso-list:l3 level1 lfo3'><![if !supportLists]><span style='font-size:11.0pt;
font-family:Symbol;color:#1F497D'><span style='mso-list:Ignore'>&middot;<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>params array (rest parameters)<o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:.75in;text-indent:-.25in;
mso-list:l0 level1 lfo4'><![if !supportLists]><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>b)<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Specify
[NotNull] for parameters that cannot be null in order to select the overload.
You can assume that parameters doesn&#8217;t have null value when called from a
DLR language. It&#8217;s not a CLR attribute though so it doesn&#8217;t prevent
a non-dynamic languages to pass null. Since the library methods are not
supposed to be called directly (only Ruby runtime should invoke the method),
you don&#8217;t need to check for non-nullity at runtime. Context parameter is always
non-null (no need to check for null at run-time). Self parameter is also non-null
unless the method is a module method or an instance method of NilClass.<o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:.75in;text-indent:-.25in;
mso-list:l0 level1 lfo4'><![if !supportLists]><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>c)<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Annotate
types by /*!*/ annotation if you assume them to be non-null. Although the
annotation doesn&#8217;t affect run-time behavior at all (being a comment, it&#8217;s
ignored by C#) it is useful for static analysis and expresses your assumptions.
<o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:.75in;text-indent:-.25in;
mso-list:l0 level1 lfo4'><![if !supportLists]><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>d)<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Note also
that unless marked by NotNull attribute, BlockParam is nullable. Hence the
overload might be eligible for invocation even though no block has been passed.
A null reference is used if the block is not specified in a call site and there
is no overload that matches better. So a single overload with BlockParam
parameter also works. It depends on the semantics of the method which variant
to chose. If presence of the block significantly changes the behavior of the
method then it&#8217;s probably better to have two overloads. Code like [RubyMethod(&#8220;foo&#8221;)]public
static Foo(&#8230; block &#8230;) { if (block != null) { 1<sup>st</sup>
overload implementation } else { 2<sup>nd</sup> overload implementation} }
should be avoided if possible; two overloads should be defined instead. On the
other hand, if the implementation almost doesn&#8217;t depend on whether the
block is present or not (it only affects a small part of the implementation)
then it&#8217;s probably better to have a single overload.<o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:.75in'><span style='font-size:
11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l2 level1 lfo2'><![if !supportLists]><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span
style='mso-list:Ignore'>2)<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Check out dynamic site in Thread.CreateThread. It should do what
you need. The magic is in ArgumentKind.List (splat).<o:p></o:p></span></p>

<p class=MsoListParagraph style='text-indent:-.25in;mso-list:l2 level1 lfo2'><![if !supportLists]><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span
style='mso-list:Ignore'>3)<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Feel free to patch the Rakefile. Note however, that we are going
to change the shape of libraries a little bit (in particular move Builtins to
IronRuby.Libraries.dll), so it might be necessary to adjust the script again afterwards.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Note that MutableString has an instance method IndexOf, so you
don&#8217;t need to convert to a CLR string (the method internally makes the conversion
but that&#8217;s only provisional implementation).<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Tomas<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
ironruby-core-bounces@rubyforge.org
[mailto:ironruby-core-bounces@rubyforge.org] <b>On Behalf Of </b>Curt
Hagenlocher<br>
<b>Sent:</b> Saturday, October 13, 2007 8:16 PM<br>
<b>To:</b> ironruby-core@rubyforge.org<br>
<b>Subject:</b> [Ironruby-core] Experimentation<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p>I thought I'd implement some missing members on the String class in order to
get my feet wet and start to understand the software.&nbsp; I chose String.scan
on the grounds that it was a fairly common function (between 20 and 30
references in the standard library) with straightforward semantics, but one
which requires dealing with overloads and blocks. <o:p></o:p></p>

<p>There are basically four variations of this function:<br>
String.scan &lt;string&gt;<br>
String.scan &lt;regexp&gt;<br>
String.scan &lt;string&gt;, &lt;block&gt;<br>
String.scan &lt;regexp&gt;, &lt;block&gt;<o:p></o:p></p>

<p>I've attempted to implement each of these, and believe that all but the last
are correct.&nbsp; The &lt;string&gt; variations are implemented in two
different flavors for both CLR strings and mutable strings.&nbsp; A patch can
be found at <a
href="http://hagenlocher.org/software/MutableString.scan.patch.txt"
target="_blank">http://hagenlocher.org/software/MutableString.scan.patch.txt</a><o:p></o:p></p>

<p>The two issues I ran into are as follows:<br>
1) The overload mechanism is picking the wrong method at runtime.&nbsp; Here
are two of the function prototypes:<o:p></o:p></p>

<p>[RubyMethodAttribute(&quot;scan&quot;, RubyMethodAttributes.PublicInstance)]<br>
public static List&lt;object&gt; Scan(MutableString/*!*/ self,
MutableString/*!*/ searchStr)<o:p></o:p></p>

<div>

<p class=MsoNormal>[RubyMethodAttribute(&quot;scan&quot;,
RubyMethodAttributes.PublicInstance)]<br>
public static object Scan(CodeContext/*!*/ context, MutableString/*!*/ self,
MutableString searchStr, BlockParam block)<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:red'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

</div>

<div>

<p class=MsoNormal>When I run from rbx.exe, I get the following:<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-family:"Courier New"'>&gt;&gt;&gt;
&quot;hello world&quot;.scan(&quot;l&quot;)<br>
=&gt; [&quot;l&quot;, &quot;l&quot;, &quot;l&quot;]</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-family:"Courier New"'>&gt;&gt;&gt;
&quot;hello world&quot;.scan(&quot;l&quot;) {|x| print x}<br>
=&gt; [&quot;l&quot;, &quot;l&quot;, &quot;l&quot;]</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>In contrast, CRuby gives this:<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-family:"Courier New"'>irb(main):001:0&gt;
&quot;hello world&quot;.scan(&quot;l&quot;)<br>
=&gt; [&quot;l&quot;, &quot;l&quot;, &quot;l&quot;]<br>
irb(main):002:0&gt; &quot;hello world&quot;.scan(&quot;l&quot;) {|x| print x} <br>
lll=&gt; &quot;hello world&quot;</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>Am I doing something wrong, or is this a bug?&nbsp; (I have
obviously updated Initializer.Generated.cs, or neither scan would have been
found :).<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>2) My implementation of String.scan &lt;regexp&gt;,
&lt;block&gt; is incomplete.&nbsp; This function is defined to behave as
follows:<o:p></o:p></p>

</div>

<p class=MsoNormal><span style='font-family:"Courier New"'>&nbsp;&nbsp;
a.scan(/\w+/) {|w| print &quot;&lt;&lt;#{w}&gt;&gt; &quot; }&nbsp; <br>
&nbsp;&nbsp; a.scan(/(.)(.)/) {|x,y| print y, x }</span><o:p></o:p></p>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>In other words, the number of parameters being passed to the
block is equal to the number of groups defined in the regular expression -- or
1 if there are no groups defined.&nbsp; I haven't been able to find way to pass
parameters&nbsp; or define a call site or that would support this. <o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>Finally, it's a bit annoying to rebuild
Initializer.Generated.cs.&nbsp; Whenever you change a method signature, you
have to manually delete the appropriate part of the old file in order to
regenerate it, or you'll get an error.&nbsp; I've made an empty version of that
source file and a batch file that copies it on top of the previous version before
rebuilding ClassInitGenerator.&nbsp; Assuming that the architecture is going to
be here for a while, it would be nice if there were a target in the Rakefile
that performed these steps. <o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>After a few more hours of this, I may have to figure out how
to do that myself. :)<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>--<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>Curt Hagenlocher<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><a href="mailto:curt@hagenlocher.org">curt@hagenlocher.org</a><o:p></o:p></p>

</div>

</div>

</body>

</html>