diff options
author | Andy Wingo <wingo@pobox.com> | 2013-02-15 11:19:10 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-02-15 11:19:10 +0100 |
commit | 564f5e70543f771e1e7c5aa57cee6f8b8d20c9ed (patch) | |
tree | d3f5287dd9a0848507043925a78d99de542e4f74 /test-suite/tests/peval.test | |
parent | 30c3dac7a671cfdfadf8452c4ff9117fc0a5b8c0 (diff) | |
download | guile-564f5e70543f771e1e7c5aa57cee6f8b8d20c9ed.tar.gz |
procedures with rest arguments can get inlined
* module/language/tree-il/peval.scm (peval): Allow inlining of
procedures with rest arguments.
* test-suite/tests/peval.test ("partial evaluation"): Add a test.
Diffstat (limited to 'test-suite/tests/peval.test')
-rw-r--r-- | test-suite/tests/peval.test | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test-suite/tests/peval.test b/test-suite/tests/peval.test index aa36182cd..fdae7b10a 100644 --- a/test-suite/tests/peval.test +++ b/test-suite/tests/peval.test @@ -843,6 +843,14 @@ (const #t)) (pass-if-peval + ;; Applications of procedures with rest arguments can get inlined. + ((lambda (x y . z) + (list x y z)) + 1 2 3 4) + (let (z) (_) ((apply (primitive list) (const 3) (const 4))) + (apply (primitive list) (const 1) (const 2) (lexical z _)))) + + (pass-if-peval ;; Constant folding: cons of #nil does not make list (cons 1 #nil) (apply (primitive cons) (const 1) (const '#nil))) |