R
RLMuller
This is a multi-part message in MIME format.
------=_NextPart_000_002A_01C37A79.49BBECF0
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Hi All,
"Programming Ruby" says the following for String#scan at =
http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_string.html#Strin=
g.scan:
a =3D "cruel world"=20
...
a.scan(/(..)(..)/) =BB [["cr", "ue"], ["l ", "wo"]]
I wrote the following to test whether scan actually produced an array or =
arrays:
a =3D "cruel world"=20
ar =3D a.scan(/(..)(..)/)
puts "Type of ar =3D %s of size %d" % [ar.class, ar.size]
ix=3D0
ar.each {|x| puts "Type of ar[#{ix}] is %s" % [ix, ar[ix].class]; =
ix+=3D1}
That resulted in:
Type of ar =3D Array of size 2
Type of ar[0] is 0
Type of ar[1] is 1
So it seem like we don't have an array of arrays. So what do we have? =
Or am I all wet?
Regards,
Richard
A programmer is a device for turning coffee into code.
Jeff Prosise (with an assist from Paul Erdos)
------=_NextPart_000_002A_01C37A79.49BBECF0
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 6.00.2800.1226" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hi All,</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>"Programming Ruby" says the following for =
String#scan at <A=20
href=3D"http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_string.ht=
ml#String.scan">http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_s=
tring.html#String.scan</A>:</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'">a =3D "cruel world"=20
<?xml:namespace prefix =3D o ns =3D =
"urn:schemas-microsoft-comfficeffice"=20
/><o></o></SPAN></CODE></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'">...<o></o></SPAN></CODE></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">a.scan(/(..)(..)/) =
</SPAN></CODE><FONT face=3D"Times New Roman">=BB =
</FONT><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'">[["cr", "ue"], ["l ", "wo"]]</SPAN></CODE></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></SPAN></CODE> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">I wrote the =
following to=20
test whether scan actually produced an array or =
arrays:</SPAN></CODE></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></SPAN></CODE> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">a =3D "cruel =
world" <BR>ar =3D=20
a.scan(/(..)(..)/)<BR>puts "Type of ar =3D %s of size %d" % [ar.class,=20
ar.size]<BR>ix=3D0<BR>ar.each {|x| puts "Type of ar[#{ix}] is %s" % [ix, =
ar[ix].class]; ix+=3D1}<BR></SPAN></CODE></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">That resulted=20
in:</SPAN></CODE></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></SPAN></CODE> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT =
face=3DArial>Type of ar=20
=3D Array of size 2<BR>Type of ar[0] is 0<BR>Type of ar[1] is=20
1</FONT></P></SPAN></CODE>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></SPAN></CODE> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">So it seem like we =
don't=20
have an array of arrays. So what do we have? Or am I all=20
wet?</SPAN></CODE></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></SPAN></CODE> </P></DIV>
<DIV><FONT size=3D2>Regards,<BR>Richard</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>A programmer is a device for turning coffee into =
code.<BR>Jeff=20
Prosise (with an assist from Paul Erdos)<BR></FONT></DIV></BODY></HTML>
------=_NextPart_000_002A_01C37A79.49BBECF0--
------=_NextPart_000_002A_01C37A79.49BBECF0
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Hi All,
"Programming Ruby" says the following for String#scan at =
http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_string.html#Strin=
g.scan:
a =3D "cruel world"=20
...
a.scan(/(..)(..)/) =BB [["cr", "ue"], ["l ", "wo"]]
I wrote the following to test whether scan actually produced an array or =
arrays:
a =3D "cruel world"=20
ar =3D a.scan(/(..)(..)/)
puts "Type of ar =3D %s of size %d" % [ar.class, ar.size]
ix=3D0
ar.each {|x| puts "Type of ar[#{ix}] is %s" % [ix, ar[ix].class]; =
ix+=3D1}
That resulted in:
Type of ar =3D Array of size 2
Type of ar[0] is 0
Type of ar[1] is 1
So it seem like we don't have an array of arrays. So what do we have? =
Or am I all wet?
Regards,
Richard
A programmer is a device for turning coffee into code.
Jeff Prosise (with an assist from Paul Erdos)
------=_NextPart_000_002A_01C37A79.49BBECF0
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 6.00.2800.1226" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hi All,</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>"Programming Ruby" says the following for =
String#scan at <A=20
href=3D"http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_string.ht=
ml#String.scan">http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_s=
tring.html#String.scan</A>:</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'">a =3D "cruel world"=20
<?xml:namespace prefix =3D o ns =3D =
"urn:schemas-microsoft-comfficeffice"=20
/><o></o></SPAN></CODE></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'">...<o></o></SPAN></CODE></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">a.scan(/(..)(..)/) =
</SPAN></CODE><FONT face=3D"Times New Roman">=BB =
</FONT><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'">[["cr", "ue"], ["l ", "wo"]]</SPAN></CODE></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></SPAN></CODE> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">I wrote the =
following to=20
test whether scan actually produced an array or =
arrays:</SPAN></CODE></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></SPAN></CODE> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">a =3D "cruel =
world" <BR>ar =3D=20
a.scan(/(..)(..)/)<BR>puts "Type of ar =3D %s of size %d" % [ar.class,=20
ar.size]<BR>ix=3D0<BR>ar.each {|x| puts "Type of ar[#{ix}] is %s" % [ix, =
ar[ix].class]; ix+=3D1}<BR></SPAN></CODE></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">That resulted=20
in:</SPAN></CODE></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></SPAN></CODE> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><FONT =
face=3DArial>Type of ar=20
=3D Array of size 2<BR>Type of ar[0] is 0<BR>Type of ar[1] is=20
1</FONT></P></SPAN></CODE>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></SPAN></CODE> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">So it seem like we =
don't=20
have an array of arrays. So what do we have? Or am I all=20
wet?</SPAN></CODE></P>
<P class=3DMsoNormal style=3D"MARGIN: 0in 0in 0pt"><CODE><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier =
New'"></SPAN></CODE> </P></DIV>
<DIV><FONT size=3D2>Regards,<BR>Richard</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>A programmer is a device for turning coffee into =
code.<BR>Jeff=20
Prosise (with an assist from Paul Erdos)<BR></FONT></DIV></BODY></HTML>
------=_NextPart_000_002A_01C37A79.49BBECF0--