;; this function is for mananing symbols inside a pattern _ for rest etc..
(define rmap_helper_lst_sym_transform
(lambda (lst)
(if (atom? lst) (set! lst (list lst)))
(if (and (= (length lst) 1) (null? (car lst))) (set! lst `(_)))
(apply append '()
(map (lambda (elt next)
(cond ((and (vector? elt) (symbol? next))
(list elt))
((list? elt)
(if (= (length elt) 1)
elt
(list elt)))
(else (list elt))))
lst
(append (cdr lst) '(0))))))