insert   xtlang


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

Implementation

(bind-func insert:[List{!a}*,List{!a}*,i64,!a]*
  (lambda (lst idx value)
    (if (= idx 0)
        (cons value lst)
        (let ((pre_cell (nth_tail lst (- idx 1)))
              (new_cell (cons value (cdr pre_cell))))
          (tset! pre_cell 1 new_cell)
          lst))))


Back to Index

Similar Entries

  • impc:aot:insert-closure-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-ext-globalvar-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-footer    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-forms    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-generic-func    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-generic-type    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-gl-proc-binding-details    scheme    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-getprocaddress.xtm
  • impc:aot:insert-globalvar-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-header    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-load-dylib-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-namedtype-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-nativefunc-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-polyfunc-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-sexpr    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-static-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-typealias-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:aot:insert-xtmacro-binding-details    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • insert-at-index    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm