ifx added by jobol on Tue Apr 26 08:37:26 2022

(define (ifx x)
   (let-syntax ((tmp (syntax-rules ()
                        ((_ value ift)     (if (equal? value x) ift))
                        ((_ value ift iff) (if (equal? value x) ift iff)))))
            tmp))

(let ((if0 (ifx 0))
      (ifa (ifx ''a)))

   (display (if0 0 'ok 'error))
   (newline)
   (display (if0 1 'error 'ok))
   (newline)
   (display (ifa 'x 'error 'ok))
   (newline)
   (display (ifa 'a 'ok 'error))
   (newline))