Name Binding Demo

Kurt NÝrmark ©     normark@cs.auc.dk
Department of Computer Science, Aalborg University

Abstract.

This is a demonstration of various name binding issues in the Scheme Elucidator. This includes examples with define-syntax and syntax-rules. Do not expect that all the illustrated Scheme functions makes sense from a semantic point of view.

In this elucidative program we have modified the program style sheet to emphasize local name bindings using a light red color.

 

1     Name binding
1.1     Short explanations
 


1.1     Short explanations

First look at p1. In the let form, car and length are simultaneously bound to length and car. Within the body of let, the names car and length refer to the locally defined name, not to R5RS names. Notice the linking from brown names to details in R5RS.

In p2 and p3 we illustrate let* and letrec instead of let. It appears that the Scheme Elucidator is aware of the different name binding techniques of let, let*, and letrec.

In p4 we see that we can locally bind the names car and cdr in a . The Elucidator is aware of these bindings.

In p5 it is illustrated that we can use lambda, case, and do as formal parameter names. In addition, we can locally bind the names length and if in a let*. Notice here, and above, that bold names are linked to R5RS.

p6 illustrates both let-syntax and syntax-rules. The Scheme Elucidator is aware the names bound in the patterns of syntax-rules, for instance car.

letrec shows an application of define-syntax, with use of the name lambda in the pattern of syntax rule (confusing, of course).

p7 shows, again, letrec-syntax and syntax-rules. In addition, there is a let name binding where the names let and if are bound.

p9, p9a, and p9b are not particular important in this context. They show the handling of different kinds of function definitions, in particular lambda form parameters.

The functions p10 and p11 show the handling of quote and quasiquote using the lexical quote notation. Similarly, p10a and p11a shows the quote, quasiquote, unquote-splicing, and unquote forms.

The function p12 illustrates a named let.