95.501 2000

 6  Macros


What's in This Set of Notes ?


6.1 Quote

Semantics:


6.2 Quasiquote

(quasiquote <template>)

Semantics:


6.3 Macros


6.4 Macros in MIT Scheme


6.5 Simple Increment Macro


6.6 Iff ... then ... else ... endif Macro

    Helper Procedures

 
(define (objects-after anObject aList)
         (if (null? aList)
              '()
              (if (equal? (car aList) anObject)
                   (cdr aList)
                   (objects-after anObject (cdr aList)))))

(define (objects-before anObject aList)
         (if (null? aList)
              '()
              (if (equal? (car aList) anObject)
                   '()
                   (cons (car aList)
                            (objects-before anObject (cdr aList))))))