示例#1
0
def pmt_to_dict(p):
    d = dict()
    items = pmt.pmt_dict_items(p)
    for i in range(pmt.pmt_length(items)):
        pair = pmt.pmt_nth(i, items)
        k = pmt.pmt_car(pair)
        v = pmt.pmt_cdr(pair)
        d[pmt_to_python(k)] = pmt_to_python(v)
    return d
示例#2
0
def pmt_to_dict(p):
    d = dict()
    items = pmt.pmt_dict_items(p)
    for i in range(pmt.pmt_length(items)):
        pair = pmt.pmt_nth(i, items)
        k = pmt.pmt_car(pair)
        v = pmt.pmt_cdr(pair)
        d[pmt_to_python(k)] = pmt_to_python(v)
    return d
示例#3
0
def pmt_to_vector(p):
    v = list()
    for i in range(pmt.pmt_length(p)):
        elem = pmt.pmt_vector_ref(p, i)
        v.append(pmt_to_python(elem))
    return v
示例#4
0
def pmt_to_tuple(p):
    elems = list()
    for i in range(pmt.pmt_length(p)):
        elem = pmt.pmt_tuple_ref(p, i)
        elems.append(pmt_to_python(elem))
    return tuple(elems)
示例#5
0
def pmt_to_vector(p):
    v = list()
    for i in range(pmt.pmt_length(p)):
        elem = pmt.pmt_vector_ref(p, i)
        v.append(pmt_to_python(elem))
    return v
示例#6
0
def pmt_to_tuple(p):
    elems = list()
    for i in range(pmt.pmt_length(p)):
        elem = pmt.pmt_tuple_ref(p, i)
        elems.append(pmt_to_python(elem))
    return tuple(elems)