lists in breve

"Anand Veeraswamy" <[email protected]> Sat, 3 Sep 2005 18:15:52 +0100
Newsgroups gmane.comp.breve
Message-ID <[email protected]>
This is a multi-part message in MIME format.

--===============54282208221844641==
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0022_01C5B0B3.84EE6E20"

This is a multi-part message in MIME format.

------=_NextPart_000_0022_01C5B0B3.84EE6E20
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

I have 2 issues while using lists in breve.

1)  If I have a nested list like tempList=3D{ {1,2}, {3,4} }
                I am able to access individual elements of this list =
using tempList{0}{0} or tempList{0}{1} which will give 1 and 2 =
respectively
                But I am unable to create a nested list using the =
following commands=20
                    tempList{0}{0} =3D 1
                    tempList{0}{1} =3D 2
                when I try using the above 2 commands I get an error =
saying that the "list index 0 is out of bounds"

                Why does this happen??=20
              =20
                Is there any other method to create nested lists?? I =
need to assign the individual elements of the nested list.

2) In order to over come this issue I started using the push list =
function
            I create 2 lists like .....
           =20
            tempList1 =3D { LifePatch (0A458E38) , LifePatch (0A459080)  =
} # LifePatch is the name of the class which inherits the Patch class
            tempList2 =3D { LifePatch (0A458E38) , LifePatch (0A458760)  =
} # The elements of the list are Patches
               =20
            Then I use the push function in this way

            push tempList1 onto pathList.           =20
            push tempList2 onto pathList.

            Now when I check the pathList I get something like this
            pathList =3D { { LifePatch (0A458E38) , LifePatch (0A458760) =
 }, [circular list reference 0A49FED0] }

            What is Circular list reference??=20

            Actually I am using a while loop to implement the above =
coding

            while(length3>=3D0): {
                i=3D0.
                tempList2{i} =3D tempList1{0}.=20
                i++.  =20
                tempList2{i} =3D neighborList{length3}.
                push tempList2 onto pathList. # At each iteration the =
list created is pushed=20
                length3--.
            }

Please help me resolve the above issues.

Thanks and regards,
Anand.
------=_NextPart_000_0022_01C5B0B3.84EE6E20
Content-Type: text/html;
	charset="iso-8859-1"
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=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2722" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have 2 issues while using lists in=20
breve.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>1)&nbsp; If I have a nested list like =
tempList=3D{=20
{1,2}, {3,4} }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; I am able to access individual =
elements of=20
this list using tempList{0}{0} or tempList{0}{1} which will give 1 =
and&nbsp;2=20
respectively</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; But I am unable to create a nested =
list=20
using the following commands </FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
tempList{0}{0}</FONT>&nbsp;<FONT face=3DArial size=3D2>=3D =
1</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
tempList{0}{1} =3D 2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; when I try using the above 2 =
commands I=20
get an error saying that the "list index 0 is out of =
bounds"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Why does this happen?? =
</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Is there any other method to =
create nested=20
lists?? I need to assign the individual elements of the nested=20
list.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>2) In order to over come this issue I =
started using=20
the push list function</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; I create 2 lists like .....</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; tempList1 =3D { LifePatch (0A458E38) , LifePatch=20
(0A459080)&nbsp; } # LifePatch is the name of the class&nbsp;which =
inherits the=20
Patch class</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
tempList2&nbsp;=3D { LifePatch (0A458E38) , LifePatch (0A458760)&nbsp; } =
# The=20
elements of the list are Patches</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; Then I&nbsp;use the push function&nbsp;in this=20
way</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; push tempList1 onto=20
pathList.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; push tempList2 onto pathList.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; Now when I check the pathList I get something like=20
this</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; pathList =3D { { LifePatch (0A458E38) , LifePatch=20
(0A458760)&nbsp; }, <U><STRONG>[circular list reference 0A49FED0]=20
</STRONG></U>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; <STRONG>What is Circular list reference??=20
</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; Actually I am using a while loop to implement the =
above=20
coding</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; while(length3&gt;=3D0):=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;=20
i=3D0.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;=20
tempList2{i} =3D tempList1{0}. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
i++.&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
tempList2{i} =3D neighborList{length3}.</FONT><FONT face=3DArial=20
size=3D2><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
push tempList2 onto pathList.&nbsp;# At each iteration the list created =
is=20
pushed=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;=20
length3--.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Please help me resolve the above=20
issues.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks and regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Anand.</FONT></DIV></BODY></HTML>

------=_NextPart_000_0022_01C5B0B3.84EE6E20--

--===============54282208221844641==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
breve mailing list
[email protected]
http://lists.spiderland.org/mailman/listinfo/breve

--===============54282208221844641==--