tag:blogger.com,1999:blog-6373963829340632529.post8949110097206001488..comments2024-01-30T05:40:30.415-03:00Comments on Algorithmically challenged: Catching ExceptionsDanielhttp://www.blogger.com/profile/07505997833685327219noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-6373963829340632529.post-11791044294512783732009-06-23T10:24:34.392-03:002009-06-23T10:24:34.392-03:00Hopefully people won't start copying it becaus...Hopefully people won't start copying it because it's already in trunk in a more general form. See scala.util.control.Exception.Paul Phillipsnoreply@blogger.comtag:blogger.com,1999:blog-6373963829340632529.post-70654796645284788282009-06-22T16:41:46.669-03:002009-06-22T16:41:46.669-03:00Yeah, I know it. But I was concentrating on captur...Yeah, I know it. But I was concentrating on capturing the exception, so I used Right in my test code. Once it was finished, I was unwilling to swap Left and Right for fear of breaking something.<br /><br />Alas, though I have heard Either described as a way to pass two alternative type values -- something like we would "union" for in C -- it seems the original intent of Either was, indeed, handling exceptions.<br /><br />I guess I might as well fix the code before people start copying it.Danielhttps://www.blogger.com/profile/07505997833685327219noreply@blogger.comtag:blogger.com,1999:blog-6373963829340632529.post-38560173524882489822009-06-22T16:25:02.973-03:002009-06-22T16:25:02.973-03:00Nice. One note; the Scaladocs for Either say that ...Nice. One note; the Scaladocs for Either say that the convention is to use Left for the exception case, when an Either is used for success vs. failure scenarios like this.Dean Wamplerhttp://programmingscala.comnoreply@blogger.com