From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1901f265c928a511 X-Google-Attributes: gid103376,public Path: g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: new revision ada Date: Tue, 22 Jun 2004 17:17:03 +0200 Organization: AdaCL Message-ID: <1774424.VSnnNmZCKX@linux1.krischik.com> References: <40BDBBFA.2020203@noplace.com> <1087475285.166449@master.nyc.kbcfp.com> <2jlepqF12qbb6U1@uni-berlin.de> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1087917512 00 16302 3JwbXkb1ZnflHfd 040622 15:18:32 X-Complaints-To: usenet-abuse@t-online.de X-ID: EYAGj2ZUwe5ielabjp7UGZT82YONFiE9x2SLFeE9yHBjSiH8-MNhYb User-Agent: KNode/0.7.7 Xref: g2news1.google.com comp.lang.ada:1783 Date: 2004-06-22T17:17:03+02:00 List-Id: James Rogers wrote: > Georg Bauhaus wrote in > news:cb927q$332$1@a1-hrz.uni-duisburg.de: > >> Ada has facilities to implement "trying-out programming". If one >> (logical) thread of control fails, and it is important to >> collect information about why it failed and in what program >> state, than save the relevant pieces of the program state >> using the executable statements of a local exception >> handler for example. >> You can store the information somewhere for lookup, and >> use Ada's exceptions, or task communication, or plain >> returned values to inform the caller of the failure or >> success. The caller can use this information to retrieve >> what has been stored for lookup. > > Your solution detaches the information from the notification. > This detachment causes problems, which are compounded by > concurrency. If two exceptions are raised in a program and > their state information is stored in some buffer such as > a protected object, how will a handler determine which state > belongs to which exception occurrence? Store them in an booch component map indexed by thread id. I do that in AdaCL.Trace. > The state information must be directly associated with the > exception occurrence. In Java this is done be creating an > exception object. References to that object are passed > up through the call stack until the exception is handled. Posible only becase Java throws pointers only. > I believe the same concept is used in C++ exceptions. With the usual amount of pitfalls which acomplished every C++ feature - yes. > Ada has a somewhat different view of exceptions. All exceptions > are the same type, and are identified by name. Ada 95 added the > ability to define exception information in a limited length > string. That string is intimately associated with an exception > occurrence. I am proposing that we provide a second kind of > exception information using a variable-width string that > encodes data in XML. XML is capable of encoding any kind of > data including very complex data structures. This new form > of exception information will allow complex exception state > data to be reliably communicated with an exception > occurrence. Again: why XML when Ada has a perfectly usable system to stream out data. i.E. 'Input and 'Output. Annex E is allready based on it so it could be used for extended exceptions as well. Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com