我不明白在最后一行写的问题是什么。 extend1是字典调度中的函数
def make_mutable_rlist(ctor=None):
"""Return a functional implementation of a mutable recursive list"""
contents = empty_rlist
if ctor != None:
i=ctor['length']()-1
print (i)
while i >=0:
contents = make_rlist(ctor['get_item'](i),contents)
i-=1
def length():
return len_rlist(contents)
def get_item(index):
return getitem_rlist(contents,index)
def push_first(value):
nonlocal contents
contents = make_rlist(value,contents)
def extend1(mutable_list):
nonlocal contents
len1 = length()-1
len2 = mutable_list['length']()
for i in range (len1,len1+len2):
contents['push_first'](mutable_list['get_item'](i))