Adding polymorphic tuples and lists to the syntax of Java
暂无分享,去创建一个
Java does not provide built-in methods for constructing and accessing tuples and lists. In other programming languages, especially functional languages, these data structures are an integral part of the language. In fact, programming without tuples and lists is inconceivable in these languages.This paper will discuss a method for adding these capabilities to Java. We propose a syntax for tuples and lists that fits in with the existing Java syntax. We define a semantics for the new constructs based on simple Java 1.4 and 1.5 classes. We describe our implementation of a source level translation for the extended language to Java.
[1] Guy L. Steele,et al. The Java Language Specification , 1996 .
[2] Peyton Jones,et al. Haskell 98 language and libraries : the revised report , 2003 .
[3] Henk J. Sips,et al. Adding tuples to Java: a study in lightweight data structures , 2002, JGI '02.
[4] Jeffrey D. Ullman. Elements of ML programming , 1994 .
[5] Simon Thompson,et al. Haskell: The Craft of Functional Programming , 1996 .