chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-janitors] #1430: local binding should not trigger scrutiniz


From: Chicken Trac
Subject: Re: [Chicken-janitors] #1430: local binding should not trigger scrutinizer warning
Date: Sun, 27 May 2018 13:30:31 -0000

#1430: local binding should not trigger scrutinizer warning
------------------------------------+--------------------
            Reporter:  felix        |      Owner:
                Type:  defect       |     Status:  new
            Priority:  major        |  Milestone:  5.0
           Component:  scrutinizer  |    Version:  4.13.0
          Resolution:               |   Keywords:
Estimated difficulty:  hard         |
------------------------------------+--------------------

Comment (by sjamaan):

 Aha! It looks like the purpose of this test is exactly to ensure that exit
 is the exit procedure and not the exit of the loop, which is why it is
 wrapped in `(f ..)`. The code is supposed to raise an exception:

 {{{
 #;1> (define-syntax loop
   (er-macro-transformer
    (lambda (x r c)
      (let ((body (cdr x)))
        `(,(r 'call/cc)
          (,(r 'lambda) (exit)
           (,(r 'let) ,(r 'f) () ,@body (,(r 'f)))))))))
 #;2> (define-syntax while0
   (syntax-rules ()
     ((_ t b ...)
      (loop (if (not t) (exit #f))
            b ...))))
 #;3> (while0 #f (print "no."))

 Error: bad argument type - not a fixnum: #f

         Call history:

         <syntax>          (##core#lambda () (if71 (not72 #f) (exit73 #f))
 (print "no.") (f77))
         <syntax>          (##core#begin (##core#if (not72 #f) (exit73 #f))
 (print "no.") (f77))
         <syntax>          (##core#if (not72 #f) (exit73 #f))
         <syntax>          (not72 #f)
         <syntax>          (exit73 #f)
         <syntax>          (##core#undefined)
         <syntax>          (print "no.")
         <syntax>          (##core#begin (f77))
         <syntax>          (f77)
         <syntax>          (##core#let () f77)
         <syntax>          (##core#begin f77)
         <syntax>          (##core#undefined)
         <eval>    (call/cc74 (lambda75 (exit) (let76 f77 () (if71 (not72
 #f) (exit73 #f)) (print "no.") (f77))))
         <eval>    ((##core#letrec* ((f77 (##core#loop-lambda () (if71
 (not72 #f) (exit73 #f)) (print "no.") (f77)))) f...
         <eval>    (not72 #f)
         <eval>    (exit73 #f)   <--
 }}}

 So the scrutinizer warning seems correct to me. If you agree, we can close
 this ticket.

--
Ticket URL: <https://bugs.call-cc.org/ticket/1430#comment:3>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]