IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New For most uses...
The difference is vanishingly small.

The main difference is that a closure is a function (more or less) and an anonymous inner class is a class. Another difference is that anonymous classes can't change method local variables, but this can be worked around. So while the syntax is definitely not nearly as nice, the functionality is pretty much there.

You might find this interesting as well: [link|http://c2.com/cgi/wiki?BlocksInJava|http://c2.com/cgi/wiki?BlocksInJava]
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New I did find that interesting. One major complaint down.
The fact that it is ugly isn't a new complaint. Java generally is ugly, I expect that.

Cheers,
Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New You'll find this interesting too - Bistro
[link|http://bistro.sourceforge.net/overview.htm|http://bistro.source....net/overview.htm]

Its a preprocessor that provides smalltalk-ish syntax and capabilities on top of Java. It generates inner classes for the closures. Its been around for at least 5 years. More of a proof of concept than a practical language - there's no debugger support or anything. But the paper is interesting.

Also, FWIW, Squeak doesn't have proper closures out of the box - it has BlockContext's instead which also don't do a good job of hanging onto local variables properly (there is a workaround you can use but you have to send the thing a message fixTemps to ask it to hang onto the temp vars).

There is a closure implementation done for Squeak, its waiting to be adopted. I think it will end up in there eventually.



"Whenever you find you are on the side of the majority, it is time to pause and reflect"   --Mark Twain

"The significant problems we face cannot be solved at the same level of thinking we were at when we created them."   --Albert Einstein

"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses."   --George W. Bush
     OT: Inner/outer classes. - (pwhysall) - (30)
         Simple explanation: - (admin)
         Wheras an "outer" class is just an ordinary class. -NT - (CRConrad)
         There's some other types as well - (ChrisR)
         Also how Java fakes friendship - (tuberculosis)
         Inner class is declared inside another class - (Arkadiy)
         Thanks all - (pwhysall) - (24)
             Re: Thanks all - (systems) - (23)
                 You misunderstand, on at least one issue: - (CRConrad) - (1)
                     No, they can be used as factories as well. - (admin)
                 s/callbacks/delegates/g - (ChrisR) - (3)
                     Yep, one of the uglier useful things in Java. :-P -NT - (admin)
                     ICLRPD (new thread) - (drewk)
                     Great - another perfectly good term hijacked and hosed (new thread) - (tuberculosis)
                 You can't do #3 - (ben_tilly) - (3)
                     For most uses... - (admin) - (2)
                         I did find that interesting. One major complaint down. - (ben_tilly) - (1)
                             You'll find this interesting too - Bistro - (tuberculosis)
                 They sorta stink as closures - (Arkadiy) - (12)
                     You need Jim Weirich's... - (ChrisR) - (11)
                         Without being rude... - (pwhysall) - (4)
                             A recursive anonymous function... - (ChrisR) - (3)
                                 Is it just interesting, or is it useful? - (pwhysall) - (2)
                                     Well, in Java it's pretty useless. -NT - (ChrisR)
                                     It's a pretty basic feature found in functional languages - (jake123)
                         Re: You need Jim Weirich's... - (JimWeirich) - (5)
                             I've just followed the first step of execution - (Arkadiy) - (4)
                                 I understand it! - (ben_tilly) - (3)
                                     Read it out loud - (drewk) - (1)
                                         I detect glazed over eyes - (ben_tilly)
                                     This was as brilliant an explanation as I've ever seen - (Arkadiy)

Dr. Ashton prescribes a nice warm cup of cloaca cocoa.
118 ms