DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Pairlis
// common LISP compatible pairlis for newLISP
;;
;;(pairlis '(1 2 3) '("one" "two" "three") '((4 "four")))
;;
(define (pairlis keys data alist)
(setq data2 data)
(setq newlist '())
(dolist (x keys)
(push (list x (pop data2)) newlist -1))
(append newlist alist))
;; newLISPy way
(define (pairlis keys data alist)
(append (map (lambda (x y) (list x y)) keys data) alist))




