torhu wrote: > On 17.11.2011 17:21, Kiith-Sa wrote: >> Performance is actually not an issue here, insignificant part of total >> parsing time is spent in Constructor (only about 2%) and any slowdown >> there should not be noticeable. >> >> The idea you're proposing here would indeed simplify the API, but >> I'm not sure if the result would always be what the user wants. >> >> Any exception (potentially user-defined) would be handled and its >> message added to a YAMLException, as we would need to catch(Exception) >> in the calling code. I can't think of an example where this could be >> a problem, since the exceptions we don't expect to be handled >> are usually derived from Throwable, but what if the user expects an >> exception to be thrown at MyStruct construction and not handled by >> D:YAML at all? >> > > Do you have an example of what that could be? OutOfMemoryError and > things like that would probably go straight through, since they are > Errors and not Exceptions.
I have changed the Constructor API in this way for now. Couldn't come up with a good counterexample. If it turns out to be a mistake, I'll change it back before 1.0 .