;;;;
; ----------------------------------------------------------------------
;;  SRFI 51 ...https://github.com/egallesio/STklos/pulls
;; ----------------------------------------------------------------------
(define rest-list '(x 1))
(define caller values)

(test "rest-values" '(1 2 3)   (let-values (((a b c) ((lambda a-b (rest-values a-b 5)) 1 2 3)))
                                 (list a b c)))

(test "rest-list"            '(x 1)       (receive (a b)  (rest-values rest-list) (list a b)))
(test "rest-list 2"          '(x 1)       (receive (a b)  (rest-values rest-list 2) (list a b)))
(test "caller rest-list"     '(x 1)       (receive (a b)  (rest-values caller rest-list) (list a b)))
(test "caller rest-list -3"  '(x 1)       (receive (a b)  (rest-values caller rest-list -3) (list a b)))
(test "rest-list -"          '(x 1 "str") (receive (a b c) (rest-values rest-list - 'y 100 "str") (list a b c)))
(test "rest-list +"          '(x 1 "str") (receive (a b c) (rest-values rest-list + `(x y z) `(100 . ,number?) `("str" . ,string?)) (list a b c)))
(test "rest-list #t"         '(x 1 "str") (receive (a b c) (rest-values rest-list #t `(x y z) `(100 . ,number?) `("str" . ,string?)) (list a b c)))
(test "rest-list #t"         '(1 "str" x) (receive (a b c) (rest-values rest-list #t `(100 . ,number?) `("str" . ,string?) `(x y z)) (list a b c)))
(test "rest-list #f"         '(1 "str" y x) (receive (a b c d) (rest-values rest-list #f `(100 . ,number?) `("str" . ,string?) `(y z)) (list a b c d)))



