Published March 6, 2022 | Version v1
Conference paper Open

A CLOS protocol for lexical environments

  • 1. Unaffiliated
  • 2. LaBRI, University of Bordeaux

Description

The concept of an environment is mentioned in many places in the
Common Lisp standard, but the nature of the object is not specified.
For the purpose of this paper, an environment is a mapping (or several
such mappings when there is more than one namespace as is the case for
Common Lisp) from names to meanings.

In this paper, we propose a replacement for the environment protocol
documented in the book ``Common Lisp the Language, second edition'' by
Guy Steele.  Rather than returning multiple values as the functions in
that protocol do, the protocol suggested in this paper is designed so
that functions return instances of standard classes.  Accessor
functions on those instances supply the information needed by a
compiler or any other code walker application.

The advantage of our approach is that a protocol based on generic
functions and standard classes is easier to extend in
backward-compatible ways than the previous protocol, so that
implementations can define additional functionality on these objects.
Furthermore, CLOS features such as auxiliary methods can be used on
these objects, making it possible to extend or override functionality
provided by the protocol, for implementation-specific purposes.
 

Files

environment-info.pdf

Files (308.3 kB)

Name Size Download all
md5:8b11247b3a53cb9a2835ce93a23898fa
308.3 kB Preview Download

Additional details

Related works

Compiles
2677-3465 (ISSN)