1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 13:30:26 +02:00

Refactor list->seq to make return arity apparent

* module/language/tree-il.scm (list->seq): Change to let tail of seq
  indicate number of values.
This commit is contained in:
Andy Wingo 2017-12-26 20:51:31 +01:00
parent 7dbc571db1
commit 140b69dfc6

View file

@ -139,9 +139,12 @@
;; A helper.
(define (list->seq loc exps)
(if (null? (cdr exps))
(car exps)
(make-seq loc (car exps) (list->seq #f (cdr exps)))))
(match exps
((exp . exps)
(let lp ((head exp) (tail exps))
(match tail
(() head)
((exp . tail) (lp (make-seq loc head exp) tail)))))))