Copy the function and rename the parameter x of p1 to a and the parameter x of p3 to b . Check the results with DrScheme's Check Syntax button. In contrast to top-level function definitions, the scope of the definitions in a local are limited. Specifically, the scope of local definitions is the local -expression. Consider the definition of an auxiliary function f in a local -expression.
Holes can also occur in the scope of a parameter definition.
The scope of the latter is nested in the scope of the former and is thus a hole for the scope of the outer use of x . In general, if the same name occurs more than once in a function, the boxes that describe the corresponding scopes never overlap. In some cases the boxes are nested within each other, which gives rise to holes. Still, the picture is always that of a hierarchy of smaller and smaller nested boxes. Draw a box around the scope of each binding occurrence of sort and alon .