Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

functional programming in the java language

Name: Anonymous 2007-06-08 11:04 ID:zBdqBvbC

http://www.ibm.com/developerworks/library/j-fp.html

now, this is where the fun bit shows up:


Listing 1. A closure in disguise


Runnable worker = new Runnable()
{
  public void run()
  {
    parseData();
  }
 };


The method parseData is literally enclosed (hence the name "closure")

Name: Anonymous 2007-06-08 16:57 ID:l8XLe0/5

Quoting random bits from >>1's URL:

Runnable()
Using closures to implement business rules
public class BinaryPredicateUnaryPredicate implements UnaryPredicate
import org.apache.commons.functor.core.composite.UnaryCompositeBinaryPredicate;
BinaryPredicateUnaryPredicate moreThanUSD100 = new BinaryPredicateUnaryPredicate (new UnaryCompositeBinaryPredicate(new IsGreaterThanOrEqual(), getItemPrice, usd100));
being able to glue small scale solutions together
Java development practices

Java is VIP quality. It's hilarious how this guy tries so hard to convince people that you can do anything decent with Java, but it's a trap, and you don't need to be Commander Ackbar to notice.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List