Defining Macros in Lisp

10/2/03


Click here to start


Table of Contents

Defining Macros in Lisp

Example: NULLIFY

Macro Expansion for NULLIFY

Macro Call Evaluation

Example: IF-N-Z-P

Macro Expansion: IF-N-Z-P

Example: PUSH (actually built-in)

Macro Expansion for PUSH

Full Macro-form Evaluation

Example: TWICE

Example: AVERAGE

Example: SET-TO-ONE

Backquote and Comma Syntax

Example: ENQUEUE

Example: SELECT

Example: SELECT

A Better Version of IF-N-Z-P

Testing the New IF-N-Z-P

What if we didn’t use GENSYM?

Simpler Version with the Same Problem

Language Extension

Remarks

Author: Steven L. Tanimoto

Email: tanimoto@cs.washington.edu

Home Page: http://www.cs.washington.edu/people/faculty/tanimoto.html

Download presentation source