tag:blogger.com,1999:blog-8736208055914730951.post859429897879509774..comments2023-10-21T09:24:50.177+01:00Comments on Mark Mahieu's blog: An unrestricted closure exampleMark Mahieuhttp://www.blogger.com/profile/13569318804515519622noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-8736208055914730951.post-91410414341849440182007-12-12T01:03:00.000+00:002007-12-12T01:03:00.000+00:00You can implement a type switch using BGGA, but no...You can implement a type switch using BGGA, but not with the control invocation syntax. Therefore, if you need to return early, you're out of luck.<BR/><BR/>Another classic problem that is much more convenient with nonlocal returns is this: you're given an Object[] that contains other Object[]s and Integers, recursively. Return the sum of all the values, or 0 if there is a 0 anywhere in the data.Neal Gafterhttps://www.blogger.com/profile/08579466817032124881noreply@blogger.com