The Right Approach to Exceptions

dennis luehring dl.soluz at gmx.net
Mon Feb 20 09:37:21 PST 2012


Am 20.02.2012 17:36, schrieb Andrei Alexandrescu:
> On 2/20/12 10:15 AM, dennis luehring wrote:
>>>  Again, I think this thread clarified we need the "Variant[string] info;"
>>>  member however we define the hierarchy.
>>
>>  to use an mighty hyper map capable of holding all informative "values"
>>  will just follow in the same amount of non-using code, and the using
>>  code will be filled up with info["blub"], info["blab"], evil castings,
>>  sensless const key-string an still no proper way to show/use the
>>  information in an generic and typesafe way
>>
>>  sorry but feels like throwing anway the signature conecpt and replace it
>>  with an runtime thing ... maybe we should also get rid of function
>>  signatures with "Variant[string] parameter" :}
>
> I understand this seems loose, but again, when you want to do custom
> formatting or i18n this is the way to go. The job of rendering the
> exception as a string must be outsourced (heh) outside the exception,
> and Variant[string] is a simple mechanism to do so.

it does not seem - it is

special_exception --> special_exception_rendere is the way

or else you need to define that clean,compile-time-safe and all the 
other stuff isn't needed anymore


More information about the Digitalmars-d mailing list