Blocks In Java

We are now moving into 2007. Several years ago I wrote this Wiki Article, I decided it was about time to split up the page as it was so long. Java has had a lot of advancements since I wrote this such as generics and auto-boxing. But I'm leaving this in its original form as it communicates the concepts simply and because I am lazy. Soon Java will have closures making much of this even simpler. Another thing, exception handling in java is kind of a mess. I'm not sure the best way to propagate exceptions from blocks but in java the simplest but PITA solution would be to have all the interfaces propagate Exception. -- RobertDiFalco


In addition to this commentary, see the JavaGenericLibrary (JGL 3.1), which has most (if not all) of these features built in.

Also see BlocksInCsharp for the CeeSharp translation of this excellent work.


See BlocksInManyLanguages, BlocksInCsharp


CategoryObjectFunctionalPatterns | CategoryClosure | CategoryJava


EditText of this page (last edited November 30, 2007) or FindPage with title or text search