# Java$\Omega$: Preprocessing Closures in Java

Bellia, Marco and Occhiuto, Maria Eugena (2009) Java$\Omega$: Preprocessing Closures in Java. Technical Report del Dipartimento di Informatica . Università di Pisa, Pisa, IT.

 Other (GZip) Available under License Creative Commons Attribution No Derivatives. Download (432Kb)

## Abstract

The paper adds a mechanism of {\em closure} to Java. We apply to closures the same technique we exploited in extending Java with methods as parameters \cite{bellia2008,bellia2008c} and we obtain a formal definition and a prototype of Java with closures. The formal definition consists of a set of source to source translation rules that state the meaning of the new construct in terms of compositions of well known ordinary Java structures. Two variants of the transformation are discussed to allow recursive defined closures and other mechanisms. The notion of {\em shared variable} as a local variable that is allocated in the heap is also discussed. Eventually, since the resulting transformation is one pass process, it can be implemented through a source to source, one pass, preprocessor \cite{bellia2007,bellia2008b}, easy to write using standard development tools \cite{levine1995,donnely2006}.

Item Type: Book OO languages, JAVA, Closures, anonymous functions, higher order programming, programming with API's, semantics, source-to-source transformations Area01 - Scienze matematiche e informatiche > INF/01 - Informatica Dipartimenti (until 2012) > DIPARTIMENTO DI INFORMATICA dott.ssa Sandra Faita 04 Dec 2014 14:20 04 Dec 2014 14:20 http://eprints.adm.unipi.it/id/eprint/2223

### Repository staff only actions

 View Item