We present a general technique for extending Java-like languages with dynamic overloading, where method selection depends on the dynamic type of the parameter, instead of just the receiver. To this aim we use a core Java-language enriched with encapsulated multi-methods and dynamic overloading. Then we define an algorithm which translates programs to standard Java code using only basic mechanisms of static overloading and dynamic binding. The translated programs are semantically equivalent to the original versions and preserve type safety.
A safe implementation of dynamic overloading in Java-like languages / L. Bettini; S. Capecchi; B. Venneri. - STAMPA. - (2010), pp. 455-462. [10.1007/978-3-642-11623-0_29]
A safe implementation of dynamic overloading in Java-like languages
BETTINI, LORENZO;VENNERI, BATTISTINA
2010
Abstract
We present a general technique for extending Java-like languages with dynamic overloading, where method selection depends on the dynamic type of the parameter, instead of just the receiver. To this aim we use a core Java-language enriched with encapsulated multi-methods and dynamic overloading. Then we define an algorithm which translates programs to standard Java code using only basic mechanisms of static overloading and dynamic binding. The translated programs are semantically equivalent to the original versions and preserve type safety.I documenti in FLORE sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.