1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-29 14:30:34 +02:00

prompts avoid introducing throw; fixup peval test

* test-suite/tests/peval.test ("partial evaluation"): Fix to expect
raise-type-error from dynwind peval.  Update prompt expectation
similarly.
* module/language/tree-il/primitives.scm (call-with-prompt): Use
raise-type-error.
This commit is contained in:
Andy Wingo 2023-11-23 12:30:36 +01:00
parent 711077586b
commit 83449a8683
2 changed files with 5 additions and 8 deletions

View file

@ -727,12 +727,9 @@
src '() #f 'args #f '() (list args)
(primcall apply handler (make-lexical-ref #f 'args args))
#f)))
(primcall throw
(const 'wrong-type-arg)
(const "call-with-prompt")
(const "Wrong type (expecting procedure): ~S")
(primcall list handler)
(primcall list handler))))))))
(primcall raise-type-error
(const #("call-with-prompt" 3 "procedure"))
handler)))))))
(else #f)))
(define-primitive-expander! 'abort-to-prompt*

View file

@ -1144,7 +1144,7 @@
(let (tmp tmp) (_ _) ((toplevel foo) (toplevel baz))
(seq (seq (if (primcall thunk? (lexical tmp _))
(call (lexical tmp _))
(primcall throw . _))
(primcall raise-type-error . _))
(primcall wind (lexical tmp _) (lexical tmp _)))
(let (tmp) (_) ((toplevel bar))
(seq (seq (primcall unwind)
@ -1234,7 +1234,7 @@
(primcall apply
(lexical handler _)
(lexical args _))))))
(primcall throw . _))))
(primcall raise-type-error . _))))
(pass-if-peval
;; `while' without `break' or `continue' has no prompts and gets its