Welcome to the CHICKEN Scheme pasting service

ir-macro pasted by sak on Fri Mar 7 21:17:45 2014

(define-syntax text-color
  (ir-macro-transformer
    (lambda (expr inject compare)
      (let ((color (cadr expr))
            (bold (cddr expr)))
        (if (null? 'bold)
           `(lambda () (attrset (COLOR_PAIR ,color)))
           `(lambda () (attrset (bitwise-ior (COLOR_PAIR ,color) ,(inject 'A_BOLD)))))))))

using matchable pasted by DerGuteMoritz on Fri Mar 7 21:23:44 2014

(import-for-syntax matchable)

(define-syntax text-color
  (ir-macro-transformer
   (lambda (expr inject compare)
     (let ((color (cadr expr))
           (bold (cddr expr)))
       (match expr
         ((_ color)
          `(lambda () (attrset (COLOR_PAIR ,color))))
         ((_ color #t)
          `(lambda () (attrset (bitwise-ior (COLOR_PAIR ,color) A_BOLD)))))))))

using matchable, take 2 added by DerGuteMoritz on Fri Mar 7 21:24:27 2014

(define-syntax text-color
  (ir-macro-transformer
   (lambda (expr inject compare)
     (match expr
       ((_ color)
        `(lambda () (attrset (COLOR_PAIR ,color))))
       ((_ color #t)
        `(lambda () (attrset (bitwise-ior (COLOR_PAIR ,color) A_BOLD))))))))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What type of object does `for-each' expect as second argument?
Visually impaired? Let me spell it for you (wav file) download WAV