Skip to Content
Programming Languages: Concepts and Implementation
book

Programming Languages: Concepts and Implementation

by Saverio Perugini
December 2021
Beginner
840 pages
47h 29m
English
Jones & Bartlett Learning
Content preview from Programming Languages: Concepts and Implementation

6.7 Dynamic Scoping

In a dynamically scoped language, the determination of the declaration to which a reference is bound requires run-time information. In a typical implementation of dynamic scoping, it is the calling sequence of procedures, and not their lexical relationship to each other, that is used to determine the declaration to which each reference is bound. While Scheme uses lexical scoping, for the purpose of demonstration, we use the following Scheme expression to demonstrate dynamic scoping:

A set of seven code lines in a Scheme expression for demonstrating dynamic scoping.
Description

In this expression we see nonlocal references to x and y in the definition of proc2 on line 2, which does not provide declarations ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Concepts and Semantics of Programming Languages 1

Concepts and Semantics of Programming Languages 1

Therese Hardin, Mathieu Jaume, Francois Pessaux, Veronique Viguie Donzeau-Gouge
Programming C# 10

Programming C# 10

Ian Griffiths

Publisher Resources

ISBN: 9781284222739