From f5fcd7f2031896cdbdc449b7c1c7305d0b9b425e Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 3 Apr 2014 16:36:23 +0200 Subject: [PATCH] build-cps niceties * module/language/cps.scm (build-cps-exp, build-cont-body): Respect unquote in list builders (kargs, call, callk, primcall, and values). --- module/language/cps.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module/language/cps.scm b/module/language/cps.scm index 00b13dde8..f5466283a 100644 --- a/module/language/cps.scm +++ b/module/language/cps.scm @@ -236,6 +236,8 @@ (make-$kif kt kf)) ((_ ($kreceive req rest kargs)) (make-$kreceive (make-$arity req '() rest '() #f) kargs)) + ((_ ($kargs (name ...) (unquote syms) body)) + (make-$kargs (list name ...) syms (build-cps-term body))) ((_ ($kargs (name ...) (sym ...) body)) (make-$kargs (list name ...) (list sym ...) (build-cps-term body))) ((_ ($kargs names syms body)) @@ -262,12 +264,16 @@ ((_ ($prim name)) (make-$prim name)) ((_ ($fun src meta free body)) (make-$fun src meta free (build-cps-cont body))) + ((_ ($call proc (unquote args))) (make-$call proc args)) ((_ ($call proc (arg ...))) (make-$call proc (list arg ...))) ((_ ($call proc args)) (make-$call proc args)) + ((_ ($callk k proc (unquote args))) (make-$callk k proc args)) ((_ ($callk k proc (arg ...))) (make-$callk k proc (list arg ...))) ((_ ($callk k proc args)) (make-$callk k proc args)) + ((_ ($primcall name (unquote args))) (make-$primcall name args)) ((_ ($primcall name (arg ...))) (make-$primcall name (list arg ...))) ((_ ($primcall name args)) (make-$primcall name args)) + ((_ ($values (unquote args))) (make-$values args)) ((_ ($values (arg ...))) (make-$values (list arg ...))) ((_ ($values args)) (make-$values args)) ((_ ($prompt escape? tag handler)) -- 2.20.1