> As you are probably aware, a closure, by definition, captures > variables from the lexically enclosing scope. Lambdaj simply does > not. They are not, therefore, closures. > > I don't mean to say lambdaj isn't useful - I'm willing to suspend > disbelief on that. They just aren't closures. > > Cheers, > Neal
Could you please better explain why the variable first of the AdderOf class in my example cannot be considered a variable captured from the lexically enclosing scope? I am sure that I am missing something but I don't understand what. Anyway I did not want to focus the discussion on my library. I was just answering to the questions of Mark Derricutt. Sorry if I went OT. As I stated somewhere else lambdaj is just an attempt to have in Java a feature that I missed (and still miss) in the language. As a fan of functional programming I would be very glad if we could have real closures built in the language. And at that point I will be happy to throw away lambdaj. What I meant to underline is something different. Let me slightly reframe the current situation in order to clarify my point of view. Two years ago, you (of course not you Neal, it is just an hypothetical example to illustrate my feeling) said to your employer that you were going to add a new fantastic feature to your product. Then you spent (wasted) the following 2 years discussing with your development team about different proposals and evaluating their consequences. At the end of this 2 endless years you went again to your employer saying that you need another year to implement a "simplified" version of that feature. I bet at this point of my hypothetical situation your boss was running through the rooms of your office like an headless chicken screaming loudly some non-repeatable words. Being one of the about 5,000,000 of Java developers in the world I suppose I am one of the employers (or customers, it is more or less the same in this context) of people who work to define the next specs of the language. And at the moment my only feeling is just that I wanna scream. -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=.
