Scala Coding
Last edited June 22, 2008
More by robin »
        /**
         * Run an operation.  If it has a result, return the result.  If no result
         * return OK.  If an exception that is part of the Error class, then return
         * that as a value, other wise allow the exception to propagate.
         */
        def OrError (op: => Any):Any =
            try {
                op match {
                    case x:Unit => OK
                    case y => y
                }
            } catch { case e:Error => e }
The content on this page is provided by a Google Notebook user, and Google assumes no responsibility for this content.