Use more cloneObject()
This commit is contained in:
parent
e0153528a1
commit
8c71fd2242
|
@ -340,14 +340,14 @@ Object filter(Object obj1, Object obj2, struct Environment *env)
|
|||
Object append(Object list, Object newElement, struct Environment *env)
|
||||
{
|
||||
Object newList = cloneObject(list);
|
||||
nf_addToList(&newList, newElement);
|
||||
nf_addToList(&newList, cloneObject(newElement));
|
||||
return newList;
|
||||
}
|
||||
|
||||
Object prepend(Object list, Object newElement, struct Environment *env)
|
||||
{
|
||||
Object newList = listObject();
|
||||
nf_addToList(&newList, newElement);
|
||||
nf_addToList(&newList, cloneObject(newElement));
|
||||
appendList(&newList, &list);
|
||||
return newList;
|
||||
}
|
||||
|
@ -364,7 +364,7 @@ Object rest(Object list, Object ignore, struct Environment *env)
|
|||
FOR_POINTER_IN_LIST(l) {
|
||||
if(POINTER == l->list)
|
||||
continue;
|
||||
nf_addToList(&ret, *POINTER);
|
||||
nf_addToList(&ret, cloneObject(*POINTER));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue