Welcome to the CHICKEN Scheme pasting service

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))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What does `(string? 42)' produce?
Visually impaired? Let me spell it for you (wav file) download WAV