Bengt Richter wrote:
On 19 Jan 2006 01:19:06 -0800, Kay Schluehr [EMAIL PROTECTED] wrote:
I want to manipulate a deeply nested list in a generic way at a
determined place. Given a sequence of constant objects a1, a2, ..., aN
and a variable x. Now construct a list from them recursively:
L =
I want to manipulate a deeply nested list in a generic way at a
determined place. Given a sequence of constant objects a1, a2, ..., aN
and a variable x. Now construct a list from them recursively:
L = [a1, [a2, [[aN, [x]]...]]
The value of x is the only one to be changed. With each value of
Kay Schluehr wrote:
I want to manipulate a deeply nested list in a generic way at a
determined place. Given a sequence of constant objects a1, a2, ..., aN
and a variable x. Now construct a list from them recursively:
L = [a1, [a2, [[aN, [x]]...]]
The value of x is the only one to be
Kay Schluehr wrote:
I want to manipulate a deeply nested list in a generic way at a
determined place. Given a sequence of constant objects a1, a2, ..., aN
and a variable x. Now construct a list from them recursively:
L = [a1, [a2, [[aN, [x]]...]]
The value of x is the only one to be
Peter Otten wrote:
Kay Schluehr wrote:
I want to manipulate a deeply nested list in a generic way at a
determined place. Given a sequence of constant objects a1, a2, ..., aN
and a variable x. Now construct a list from them recursively:
L = [a1, [a2, [[aN, [x]]...]]
The value
Kay Schluehr wrote:
The structure of the sequence is not optional. Of course you can also
take the original sequence and apply:
L = list([a1, [a2, [[aN, [x]]...]]) # shallow copy
L[0] = b
I don't understand the example. Wouldn't you have to do
L[1][1]...[1] = b
to change x?
but
Kay Schluehr wrote:
I want to manipulate a deeply nested list in a generic way at a
determined place. Given a sequence of constant objects a1, a2, ..., aN
and a variable x. Now construct a list from them recursively:
L = [a1, [a2, [[aN, [x]]...]]
The value of x is the only one to be
On 19 Jan 2006 01:19:06 -0800, Kay Schluehr [EMAIL PROTECTED] wrote:
I want to manipulate a deeply nested list in a generic way at a
determined place. Given a sequence of constant objects a1, a2, ..., aN
and a variable x. Now construct a list from them recursively:
L = [a1, [a2, [[aN,