[Tutor] a string of nested-list to a list?

pan pan" <prog@runsun.info
Thu Mar 27 09:48:02 2003


This is a multi-part message in MIME format.

--_b02077e83bf83c187f99289a6d93a0043
Content-Type: text/plain;
	charset="Big5"
Content-Transfer-Encoding: quoted-printable

Any eazy way to convert a string of nested-list into a list?

An example:

target =3D '[[a,b], [[c,d],e]]]'
result =3D [ ['a','b'], [['c','d'], 'e'] ]

Basically it's a reverse action of repr().

thx in advance.

pan
=0A=0A=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
~~~~~ be shapeless ~~~~~

Runsun Pan, PhD
Dept. of Ecology & Evolution
U. of Chicago, USA
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

--_b02077e83bf83c187f99289a6d93a0043
Content-Type: text/html;
	charset="Big5"
Content-Transfer-Encoding: quoted-printable

<html>=0A<head>=0A<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DBig5">=0A</head>=0A<body>=0AAny eazy way to convert a string of nested-list into a list?=0D<br>=0A=0D<br>=0AAn example:=0D<br>=0A=0D<br>=0Atarget =3D '[[a,b], [[c,d],e]]]'=0D<br>=0Aresult =3D [ ['a','b'], [['c','d'], 'e'] ]=0D<br>=0A=0D<br>=0ABasically it's a reverse action of repr().=0D<br>=0A=0D<br>=0Athx in advance.=0D<br>=0A=0D<br>=0Apan=0D<br>=0A<br>=0A=0A=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br />
~~~~~ be shapeless ~~~~~<br />
<br />
Runsun Pan, PhD<br />
Dept. of Ecology & Evolution<br />
U. of Chicago, USA<br />
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A</body></html>=0A

--_b02077e83bf83c187f99289a6d93a0043--