On Jun 11, 2011, at 2:26 AM, Charles Oliver Nutter wrote: > On Fri, Jun 10, 2011 at 7:11 PM, Charles Oliver Nutter > <head...@headius.com> wrote: >> Ok, John Rose pointed out on MLVM list that a finally that does not >> return would be the same as foldArguments, by flipping the order: >> >> int foo(Object arg1) { >> ... return some int >> } >> >> int postCall(int retVal, Object arg1) { >> post(arg1); >> return retVal; >> } >> >> MethodHandle result = MethodHandles.foldArguments(postCall, foo); >> >> foo's return value then gets inserted into postCall's param list, and >> you can either use it or not. Clever...I didn't think to reverse the >> order of foldArguments. > ... >> MethodHandle result = MethodHandles.foldArguments(postCall, foo); >> result = MethodHandles.catchException(result, Throwable.class, >> postException); >> >> The postCall logic could raise an exception that postException is not >> meant to handle. Am I wrong? > > I think I have it, and maybe I am wrong after all!
What!!! Last time I stick my neck out for you!!! ;-) Kirk -- You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to jvm-languages@googlegroups.com. To unsubscribe from this group, send email to jvm-languages+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en.