[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
#1765: enable-warnings time-travelling shenanigans
From: |
Chicken Trac |
Subject: |
#1765: enable-warnings time-travelling shenanigans |
Date: |
Sat, 12 Jun 2021 10:44:49 -0000 |
#1765: enable-warnings time-travelling shenanigans
---------------------------------------+---------------------
Reporter: Idiomdrottning | Type: defect
Status: new | Priority: major
Milestone: someday | Component: unknown
Version: 5.2.0 | Keywords: REPL
Estimated difficulty: |
---------------------------------------+---------------------
(import miscmacros (chicken condition))
(define-syntax-rule
(bound-procedure? name)
(handle-exceptions
ex
#f
(procedure? name)))
(enable-warnings #f)
(define wtf (bound-procedure? if))
(enable-warnings #t)
wtf
;; ↑↑ quietly and politely evals to #f
(begin
(enable-warnings #f)
(define wtf (bound-procedure? if))
(enable-warnings #t)
wtf)
;; ↑↑ expands to a let form (which is fine of course) and complains in
;; the REPL because warnings apply retroactively to the entire form.
I've tried enabling the warnings via (let ((ret ...)) enable ret) dynamic-
wind or via force/delay or via just a lambda that gets called, but no
matter how I do it, it retroactively wants to print warnings.
I even did
(define (re-enable-warnings val ret)
(enable-warnings val)
ret)
(re-enable-warnings #f (bound-procedure? if))
;;; politely evals to #f
(re-enable-warnings #t (bound-procedure? if))
;;; causes a ruckus
The time travelling super powers of call-with-current-continuation that
the REPL uses is haunting me…!
This just can't be right!
--
Ticket URL: <https://bugs.call-cc.org/ticket/1765>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.
- #1765: enable-warnings time-travelling shenanigans,
Chicken Trac <=