From APIs to Languages: Generalising Method Names

Abstract

Method names with multiple separate parts are a feature of many dynamic languages derived from Smalltalk. Generalising the syntax of method names to allow parts to be repeated, optional, or alternatives, means a single definition can respond to a whole family of method requests. We show how generalising method names can support flexible APIs for domain-specific languages, complex initialisation tasks, and control structures defined in libraries. We describe how we have extended Grace to support generalised method names, and prove that such an extension can be integrated into a gradually-typed language while preserving type soundness.

Authors

Michael Homer, Timothy Jones, James Noble

Published in

Dynamic Language Symposium (DLS), 2015

The final copy of this publication is available from the publisher.

Resources

PDF
mwh.nz/pdf/dls2015
this page
mwh.nz/pubs/dls2015
Michael Homer — 2023 d38f60fb