diff options
author | Andy Wingo <wingo@pobox.com> | 2012-07-05 20:30:18 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2012-07-05 20:30:18 +0200 |
commit | 3d2bcd2c350384ffaf96b79fa6096c9d77ea113e (patch) | |
tree | aa0043f263e6dcfcc4c1510074542d0848445593 /test-suite/tests/peval.test | |
parent | c0cfa9ef07aad3afef822d1afe1786eb655bd121 (diff) | |
download | guile-3d2bcd2c350384ffaf96b79fa6096c9d77ea113e.tar.gz |
optimize (apply foo 0 (list 1 2)) => (foo 0 1 2)
* module/language/tree-il/peval.scm (peval): Inline applications where
we know the contents of the tail.
* test-suite/tests/peval.test ("partial evaluation"): Add tests.
Diffstat (limited to 'test-suite/tests/peval.test')
-rw-r--r-- | test-suite/tests/peval.test | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test-suite/tests/peval.test b/test-suite/tests/peval.test index aefb2e04e..1f641d93c 100644 --- a/test-suite/tests/peval.test +++ b/test-suite/tests/peval.test @@ -1055,4 +1055,12 @@ (apply (toplevel baz) (toplevel x)) (apply (lexical failure _))))) (apply (lexical failure _))) - (apply (lexical failure _)))))) + (apply (lexical failure _))))) + + (pass-if-peval resolve-primitives + (apply (lambda (x y) (cons x y)) '(1 2)) + (apply (primitive cons) (const 1) (const 2))) + + (pass-if-peval resolve-primitives + (apply (lambda (x y) (cons x y)) (list 1 2)) + (apply (primitive cons) (const 1) (const 2)))) |