delete   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/adt.xtm

Implementation

(bind-func delete:[!a,List{!a}*,i64]*
  (lambda (lst idx)
    (let ((pre_cell (nth_tail lst (- idx 1)))
          (cell (cdr pre_cell))
          (post_cell (cdr cell)))
      (tset! pre_cell 1 post_cell)
      (car cell))))


Back to Index

Similar Entries