list.c
void list_remove(atom_t* obj, int index, char unbind) {
    list_assert(obj, "list_rem");
    if (index >= list_len(obj) || index < 0) {
        printf("\x1b[95m" "Fatal error: list_rem: index is out of range!\n" "\x1b[0m");
        exit(EXIT_FAILURE);
    }

    list_t* l = obj->val.list;

    if (unbind) {
        atom_unbind(l->items[index], obj);
        atom_del(l->items[index]);
    }

    memmove(l->items + index, l->items + index + 1, (l->len - index - 1) * sizeof(atom_t*));
    --l->len;
}
/*
--------------------------------------
list_remove

    Remove item at index from the list.
--------------------------------------
*/
list_remove
Remove item at index from the list.
list_remove Remove item at index from the list .
void list_remove(atom_t* obj, int index, char unbind) {
    list_assert(obj, "list_rem");
    if (index >= list_len(obj) || index < 0) {
        printf("\x1b[95m" "Fatal error: list_rem: index is out of range!\n" "\x1b[0m");
        exit(EXIT_FAILURE);
    }
    list_t* l = obj->val.list;
    if (unbind) {
        atom_unbind(l->items[index], obj);
        atom_del(l->items[index]);
    }
    memmove(l->items + index, l->items + index + 1, (l->len - index - 1) * sizeof(atom_t*));
    --l->len;
}
void list_remove ( atom_t * obj , int index , char unbind ) { list_assert ( obj , " " ) ; if ( index >= list_len ( obj ) || index < 0 ) { printf ( " \x1b " " \n " " \x1b " ) ; exit ( EXIT_FAILURE ) ; } list_t * l = obj -> val . list ; if ( unbind ) { atom_unbind ( l -> items [ index ] , obj ) ; atom_del ( l -> items [ index ] ) ; } memmove ( l -> items + index , l -> items + index + 1 , ( l -> len - index - 1 ) * sizeof ( atom_t * ) ) ; -- l -> len ; }
list_remove
Remove item at index from the list.
list_remove Remove item at index from the list .