ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Lisp and Java
Subject:   More Functional Programming Beauti in Java
Date:   2004-03-30 00:58:31
From:   joostd
In the forthcoming 1.5 release of J2SE, there's another influence from functional programming languages that is finally being incorporated into Java: generics.


Generics will let you write code that not only abstracts over common code, but also over common types. This is great for Java, where using Collection classes drives you nuts with typecasts. with J2SE 1.5, you can write functions that manipulate collections without stating explicitely what data is contained in a collection (and without casting back-and-forth to type Object).


See also: JSR 14.


LISP is an untyped language, so it does not need generics. If you want to check out a beautiful functional programming language with a more conventional syntax than LISP, and with higher-order functions, polymorphism (like generics), and much more, have a look at Haskell.