Sponsored Links

 

 

 

GJ: Extending the Java programming language with type parameters

Source: homepages.inf.ed.ac.uk
Topic: Java Programming


Short Desciption:
This note proposes GJ an extension to the Java programming language that ... GJ is backward and forward compatible with the Java programming language and ...

 

Content Inside:
GJ: Extending the Java programming language with type parametersPage 1GJ: Extending the JavaTMprogramming language with typeparametersGilad Bracha Sun MicrosystemsMartin Odersky University of South AustraliaDavid Stoutamire Sun MicrosystemsPhilip Wadler Bell Labs Lucent TechnologiesMarch 1998; revised August 1998Say you wish to process collections. Some may be collections of bytes others collections of strings and yet others collections of collections of strings. The Java programming language supports such variation by allowing you to form a collection of Objectso the elements may have any reference type. In order to keep the language simpleyou are forced to do some of the work yourself: you must keep track of the fact thatyou have a collection of bytes and when you extract an element from the collection youmust cast it to class Byte before further processing.This situation is becoming more common as the Java platform evolves notably withthe addition of collection classes to JDK 1.2. Other languages provide additional supportfor this situation: in C++ it is supported with templates; in Ada it is supported withgenerics; and in ML and Haskell it is supported with parametric polymorphism.This note proposes GJ an extension to the Java programming language that supports types with parameters. GJ programs look much like the equivalent Java programsexcept they have more type information and fewer casts. The semantics of GJ is givenby a translation into the Java programming language. The translation erases type parameters replaces type variables by their bounding type (typically Object) adds castsand inserts bridge methods so that overriding works properly. The resulting programis pretty much what you would write if generics werent available. The translation isdesigned so that new GJ code will work with existing Java libraries even when thelibraries are available only in binary class file form.GJ comes with a castiron guarantee: no cast inserted by the compiler will ever fa ...

 

add to Google Reader add to Google Bookmark add to bloglines add to newsgator add to FURL add to digg add to webnews add to Netscape add to Yahoo MyWeb add to spurl.net add to diigo Bookmark newsvine Bookmark del.icio.us Bookmark @ SIMPIFY Bookmark MISTER WONG Bookmark Linkarena Bookmark icio.de Bookmark oneview Bookmark folkd.com Bookmark yigg.de Bookmark reddit Bookmark StumbleUpon Bookmark Slashdot Bookmark blinklist Bookmark technorati add to blogmarks add to blinkbits add to ma.gnolia add to smarking.com add to netvouz add to co.mments add to Connotea add to de.lirio.us

 

Related PDF Files

Sunrevised.qxd (Page 1)


Topic: Java Programming

Fundamentals of UNIX and Fundamentals of Java Programming. Sponsored by Sun Microsystems ... programming and the Java language to solve business problems. ...

Adding Wildcards to the Java Programming Language


Topic: Java Programming

Adding Wildcards to the Java Programming Language Mads Torgersen Christian Plesner Hansen Erik Ernst, and Peter von der Ah´ e University of Aarhus Åbogade 34 DK-8200 ÅrhusN ...

No Slide Title


Topic: Java Programming

Forthcoming Java Programming Language Features. 2. A Brief History of the Java. . Programming Language. . 1995 (1.0)First public release ...

Java Programming Guide Quick Reference 1999 Pinnacle Software ...


Topic: Java Programming

javac abc.java. 4. After compilation run the program using the Java ... Example: java abc. 5. The program output will be displayed on the command line. ...

com ™ Java XML Application Categories


Topic: Java Programming

... persistence engines (relational or object databases) and even the web (dynamically generated websites that supply only XML data). In your application layer, you can create many interesting Java ...

 

Sponsored Links