Next: , Up: chains   [Index]


35.1 Introduction to chains

To understand the chains API we need to understand the following terms: previous link, next link, first link, last link, front link, rear link, forwards direction, backwards direction. Here is an explicative picture:

first          prev     this    next           last
 v               v       v       v               v
 O <---> O <---> O <---> O <---> O <---> O <---> O
 ^                                               ^
front                                          rear

                 forwards direction
               ---------------------->

                 backwards direction
               <----------------------

Every link in a chain is an instance of R6RS record of type <chain-link>. Every link references its previous link and next link. Empty chains are represented by the built–in null object.