[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 07/16: Refactor list->seq to make return arity apparent
From: |
Andy Wingo |
Subject: |
[Guile-commits] 07/16: Refactor list->seq to make return arity apparent |
Date: |
Wed, 27 Dec 2017 10:02:47 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit 140b69dfc653c27b59570c9050e8b0909fd296b9
Author: Andy Wingo <address@hidden>
Date: Tue Dec 26 20:51:31 2017 +0100
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.
---
module/language/tree-il.scm | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/module/language/tree-il.scm b/module/language/tree-il.scm
index 5fb0ce0..88e943b 100644
--- a/module/language/tree-il.scm
+++ b/module/language/tree-il.scm
@@ -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)))))))
- [Guile-commits] branch master updated (da7144d -> 108ade6), Andy Wingo, 2017/12/27
- [Guile-commits] 01/16: Fix stack effect/clobber parsing for calls, Andy Wingo, 2017/12/27
- [Guile-commits] 04/16: Reify-primitives removes "/unlikely" ephemeral instructions, Andy Wingo, 2017/12/27
- [Guile-commits] 07/16: Refactor list->seq to make return arity apparent,
Andy Wingo <=
- [Guile-commits] 05/16: Remove compile-bytecode cases for ephemeral primitives, Andy Wingo, 2017/12/27
- [Guile-commits] 12/16: CPS conversion avoids residualizing unknown primcalls, Andy Wingo, 2017/12/27
- [Guile-commits] 06/16: Refactor reify-primitives pass, Andy Wingo, 2017/12/27
- [Guile-commits] 08/16: Flesh out compile-bytecode for all heap objects, Andy Wingo, 2017/12/27
- [Guile-commits] 15/16: Unknown primcalls convert as calls, Andy Wingo, 2017/12/27
- [Guile-commits] 13/16: Contification also inlines "elide-values" pass, Andy Wingo, 2017/12/27
- [Guile-commits] 10/16: CPS conversion expands "list", Andy Wingo, 2017/12/27
- [Guile-commits] 11/16: Inline "elide-values" optimization into CPS conversion, Andy Wingo, 2017/12/27
- [Guile-commits] 09/16: Refactor lowering of Tree-IL primcalls to CPS, Andy Wingo, 2017/12/27
- [Guile-commits] 16/16: Re-add support for logbit?, Andy Wingo, 2017/12/27