pop   xtlang


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

Implementation

(bind-func pop:[!a,List{!a}*]*
  "pop first element from list (modifies list in-place)"
  (lambda (lst)
    (if (null? lst)
        (convert null)
        (let ((element (car lst)))
          (set! lst (cdr lst))
          element))))


Back to Index

Similar Entries