Proceedingsbeitrag
Zitieren …

Towards Virtual Traits in Scala

Manuel Weiel, Ingo Maier, Sebastian Erdweg ORCID-iD-Icon 1, Michael Eichberg und Mira Mezini
1 Institut für Programmstrukturen und Datenorganisation (IPD), Karlsruher Institut für Technologie (KIT)
Abstract

Scala is a powerful language that supports a variety of fea- tures, but it lacks virtual traits. Virtual traits are class- valued object attributes and can be redefined within sub- traits. They support higher-order hierarchies and family polymorphism. This work introduces virtual traits into Scala and explains how to encode virtual traits on top of existing Scala features. We have implemented this encoding using Scala annotation macros and have conducted two small case studies.