<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>3.3. The lexical environment</title><link rel="stylesheet" href="ecl.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="The ECL manual"><link rel="up" href="ch26.html" title="Chapter 3. The interpreter"><link rel="prev" href="ch26s02.html" title="3.2. Procedure Call Conventions"><link rel="next" href="ch26s04.html" title="3.4. The interpreter stack"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.3. The lexical environment</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch26s02.html">Prev</a> </td><th width="60%" align="center">Chapter 3. The interpreter</th><td width="20%" align="right"> <a accesskey="n" href="ch26s04.html">Next</a></td></tr></table><hr></div><div class="section" title="3.3. The lexical environment"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Internals-The-lexical-environment"></a>3.3. The lexical environment</h2></div></div></div><p>The <span class="application">ECL</span> interpreter uses two A-lists (Association lists) to represent lexical environments.</p><div class="itemizedlist"><ul class="itemizedlist" type="bullet"><li class="listitem" style="list-style-type: disc"><p>One for variable bindings</p></li><li class="listitem" style="list-style-type: disc"><p>One for local function/macro/tag/block bindings</p></li></ul></div><p>When a function closure is created, the current two A-lists are saved in the closure along with the lambda expression. Later, when the closure is invoked, the saved A-lists are used to recover the lexical environment.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch26s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch26.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch26s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.2. Procedure Call Conventions </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.4. The interpreter stack</td></tr></table></div></body></html>