First-class classes add expressive power to class-based object-oriented languages. Most importantly, programmers ract over common scenarios with first-class classes. When it comes to behavioral software contracts, however, first-class classes pose significant challenges. In this paper, we present the first contract system for a programming language with first-class classes. The design has been implemented for Racket, which supports first-class classes and which implements mixins and traits as syntactic sugar. We expect that our experience also applies to languages with native mixins and/or traits. Categories and Subject Descriptors D [2]: 3 Objectoriented programming; D [2]: 4 Programming by contract General Terms Reliability Keywords contracts, first-class class systems
T. Stephen Strickland, Matthias Felleisen