diff options
author | Andy Wingo <wingo@pobox.com> | 2020-05-04 10:44:10 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2020-05-04 10:53:29 +0200 |
commit | 167350db21df51b146b11aaeb9691c39f63ed1cc (patch) | |
tree | 78eec7c1c5859fede6415163499f8931425b6e33 /test-suite/tests/peval.test | |
parent | d6b6daca372e3a7d2abc601e2b60d6c2cc6c0abc (diff) | |
download | guile-167350db21df51b146b11aaeb9691c39f63ed1cc.tar.gz |
Ensure <prompt> handler is values handler
* module/language/tree-il/primitives.scm (call-with-prompt): Only pass
"values handlers" as handler: lambdas with only req and rest args, and
only one clause.
* module/language/tree-il/compile-cps.scm (canonicalize): Remove
eta-conversion pass here.
* test-suite/tests/peval.test ("partial evaluation"): Adapt test.
Diffstat (limited to 'test-suite/tests/peval.test')
-rw-r--r-- | test-suite/tests/peval.test | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/test-suite/tests/peval.test b/test-suite/tests/peval.test index 2eecc8218..3805259f0 100644 --- a/test-suite/tests/peval.test +++ b/test-suite/tests/peval.test @@ -1223,13 +1223,21 @@ (call-with-prompt tag (lambda () 1) handler) - (prompt #f - (toplevel tag) - (lambda _ - (lambda-case - ((() #f #f #f () ()) - (const 1)))) - (toplevel handler))) + (let (handler) (_) ((toplevel handler)) + (if (primcall procedure? (lexical handler _)) + (prompt #f + (toplevel tag) + (lambda _ + (lambda-case + ((() #f #f #f () ()) + (const 1)))) + (lambda _ + (lambda-case + ((() #f args #f () (_)) + (primcall apply + (lexical handler _) + (lexical args _)))))) + (primcall throw . _)))) (pass-if-peval ;; `while' without `break' or `continue' has no prompts and gets its |