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:
parent
7dbc571db1
commit
140b69dfc6
1 changed files with 6 additions and 3 deletions
|
@ -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)))))))
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue