Pass-by-subclass parameters

  • Authors:
  • Anders Bach Madsen;Erik Ernst

  • Affiliations:
  • Aarhus University, Denmark;Aarhus University, Denmark

  • Venue:
  • Proceedings of the 4th Workshop on MechAnisms for SPEcialization, Generalization and inHerItance
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Parameter passing comes in many variants, e.g., pass-by-reference, pass-by-value, and pass-by-value-result. This paper shows how the ability of subclasses to provide bindings for already declared entities can be used as a parameter passing mechanism, and how it is particularly useful in situations where computations involving types are used. Such subclasses are not optimized for being beautiful expositions of application domain concepts, they are much more like function applications or method calls: They occur inline in "client code", they may bind relatively complex expressions, and they rely on the local context as well as more remote declarations for the raw material to build these expressions. We consider these issues in context of an imperative language, and hence we need to obtain immutable references to entities accessible via mutable references. This is crucial when those entities are used as first class packages, i.e., when lookups into these entities are used to obtain types. The combination of these two features---the ability to obtain an immutable reference from a mutable reference, and the ability to perform computations on types---give rise to a surprisingly complex computational universe, and we show how this implies that an otherwise reasonable theorem turns out to be incorrect.