In the language I"m implementing, catching is done not based on the class of the thrown object but on its identity. That is, in the general case, the throw will have to wrap the object in a descendant of RuntimeException (which I call CatchPoint), and then each catcher routine will begin with a line like "if (e.object != object_we_want) throw e;" in order to rethrow the exception if the object is not identical.
Often, but not always, the object is a constant and its identity is known at compile time. Is it worthwhile creating unique subclasses of CatchPoint, one for each such manifest thrown object, so that the above test can be omitted? -- GMail doesn't have rotating .sigs, but you can see mine at http://www.ccil.org/~cowan/signatures --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" 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/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---
