Scheme with classes, mixins, and traits

  • Authors:
  • Matthew Flatt;Robert Bruce Findler;Matthias Felleisen

  • Affiliations:
  • University of Utah;University of Chicago;Northeastern University

  • Venue:
  • APLAS'06 Proceedings of the 4th Asian conference on Programming Languages and Systems
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

The Scheme language report advocates language design as the composition of a small set of orthogonal constructs, instead of a large accumulation of features. In this paper, we demonstrate how such a design scales with the addition of a class system to Scheme. Specifically, the PLT Scheme class system is a collection of orthogonal linguistic constructs for creating classes in arbitrary lexical scopes and for manipulating them as first-class values. Due to the smooth integration of classes and the core language, programmers can express mixins and traits, two major recent innovations in the object-oriented world. The class system is implemented as a macro in terms of procedures and a record-type generator; the mixin and trait patterns, in turn, are naturally codified as macros over the class system.