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.
Keywords
- Class System
- Method Call
- Multiple Inheritance
- Initialization Argument
- Method Declaration
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
This is a preview of subscription content, access via your institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Abelson, H., Sussman, G.J.: Structure and Interpretation of Computer Programs. MIT Press, Cambridge (1984)
Adams, N., Rees, J.: Object-oriented programming in Scheme. In: Proc. ACM Conference on Lisp and Functional Programming, pp. 277–288 (1988)
Allen, E., Chase, D., Luchangco, V., Maessen, J.-W., Ryu, S., Steek Jr., G.L., Tobin-Hochstadt, S.: The Fortress language specification (2006)
Ancona, D., Lagorio, G., Zucca, E.: Jam -designinga Java extension with mixins. ACM Transactions on Computing Systems 25, 641–712 (2003)
Ancona, D., Zucca, E.: An algebraic approach to mixins and modularity. In: Hanus, M., Rodríguez-Artalejo, M. (eds.) ALP 1996. LNCS, vol. 1139, pp. 179–193. Springer, Heidelberg (1996)
Ancona, D., Zucca, E.: Aprimitive calculus for module systems. In: Nadathur, G. (ed.) PPDP 1999. LNCS, vol. 1702, pp. 62–79. Springer, Heidelberg (1999)
Barzilay, E.: Swindle (2002), http://www.barzilay.org/Swindle/
Benson Jr., Brent, W.: libscheme: Scheme as a C library. In: Proc. USENIX Symposium on Very High Level Languages (1994)
Black, A.P., Schärli, N., Ducasse, S.: Applying traits to the Smalltalk collection hierarchy. In: Proc. ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 47–64 (October 2003)
Bracha, G.: The Programming Language Jigsaw: Mixins, Modularity and Multiple Inheritance. Ph.D. thesis, Dept. of Computer Science, University of Utah (March 1992)
Bracha, G., Cook, W.: Mixin-based inheritance. In: Proc. Joint ACM Conf. on Object-Oriented Programming, Systems, Languages and Applications and the European Conference on Object-Oriented Programming (October 1990)
Dybvig, R.K., Hieb, R., Bruggeman, C.: Syntactic abstraction in Scheme. Lisp and Symbolic Computation 5(4), 295–326 (1993)
Findler, R.B., Flanagan, C., Flatt, M., Krishnamurthi, S., Felleisen, M.: DrScheme: A pedagogic programming environment for Scheme. In: Hartel, P.H., Kuchen, H. (eds.) PLILP 1997. LNCS, vol. 1292, pp. 369–388. Springer, Heidelberg (1997)
Fisherand, K., Reppy, J.: A typed calculus of traits. In: Proc. ACM International Workshop on Foundations of Object-Oriented Languages (2004)
Flatt, M.: Compilable and composable macros. In: Proc. ACM International Conference on Functional Programming (October 2002)
Flatt, M., Felleisen, M.: Units: Cool modules for HOT languages. In: Proc. ACM Conference on Programming Language Design and Implementation, pp. 236–248 (June 1998)
Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: Proc. ACM Symposium on Principles of Programming Languages, pp. 171–183 (January 1998)
Friedman, D.P.: Object-oriented style (invited talk). In: International LISP Conference (2003)
Goldberg, D., Findler, R.B., Flatt, M.: Super and inner — together at last! In: Proc. ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 116–129 (October 2004)
Kelsey, R., Clinger, W., Rees, J. (eds.): The revised 5 report on the algorithmic language Scheme. ACM SIGPLAN Notices, vol. 33(9) (September 2004)
Lamping, J.: Typing the specialization interface. In: Proc. ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 201–214 (1993)
Lehrmann Madsen, O., Møller-Pedersen, B., Nygaard, K.: Object-oriented programming in the BETA programming language. ACM Press/Addison-Wesley (1993)
Moon, D.A.: Object-oriented programming with Flavors. In: Proc. ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 1–8 (November 1986)
Oderskyand, M., Zenger, M.: Scalable component abstractions. In: Proc. ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 41–57 (2005)
PLT Scheme (2006), http://www.plt-scheme.org
Queinnec, C.: Meroon V3: A Small, Efficient, and Enhanced Object System (1997)
Reppy, J., Turon, A.: A foundation for trait-based metaprogramming. In: Proc. ACM International Workshop on Foundations of Object-Oriented Languages (2006)
Schärli, N.: Composing Classes from Behavioral Building Blocks. PhD thesis, University of Berne (2002)
Schärli, N., Ducasse, S., Nierstrasz, O., Black, A.P.: Traits: Composable units of behaviour. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 248–274. Springer, Heidelberg (2003)
Smaragdakis, Y., Batory, D.: Implementing layered designs with mixin layers. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 550–570. Springer, Heidelberg (1998)
Smart, J., et al.: wxWindows, http://web.ukonline.co.uk/julian.smart/wxwin/
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Flatt, M., Findler, R.B., Felleisen, M. (2006). Scheme with Classes, Mixins, and Traits. In: Kobayashi, N. (eds) Programming Languages and Systems. APLAS 2006. Lecture Notes in Computer Science, vol 4279. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11924661_17
Download citation
DOI: https://doi.org/10.1007/11924661_17
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-48937-5
Online ISBN: 978-3-540-48938-2
eBook Packages: Computer ScienceComputer Science (R0)
