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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11232c,606685f2786a81e9 X-Google-Attributes: gid11232c,public X-Google-Thread: 103376,8f2146b9c1ab93cc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-04 15:21:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.mailgate.org!mygate.mailgate.org!198.207.153.205!not-for-mail From: "Kent Paul Dolan" Newsgroups: comp.lang.ada,misc.misc Subject: Re: Upping the ante (was): ToString? Date: Thu, 4 Apr 2002 23:21:47 +0000 (UTC) Organization: Mailgate.ORG Server - http://www.Mailgate.ORG Message-ID: <6e9cd02332705638a4cd86a4a2f521e7.48257@mygate.mailgate.org> References: <3C918515.20808@worldnet.att.net> NNTP-Posting-Host: 198.207.153.205 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.mailgate.org 1017944337 29669 198.207.153.205 (Fri Apr 5 01:21:47 2002) X-Complaints-To: abuse@mailgate.org NNTP-Posting-Date: Thu, 4 Apr 2002 23:21:47 +0000 (UTC) Injector-Info: news.mailgate.org; posting-host=198.207.153.205; posting-account=48257; posting-date=1017944337 User-Agent: Mailgate Web Server X-URL: http://mygate.mailgate.org/mynews/comp/comp.lang.ada/6e9cd02332705638a4cd86a4a2f521e7.48257%40mygate.mailgate.org Xref: archiver1.google.com comp.lang.ada:22117 misc.misc:6101 Date: 2002-04-04T23:21:47+00:00 List-Id: "Jim Rogers" wrote: > Unfortunately, there is no such implied contract in Java. > Every object (non-primitive type) will have a toString() method. > It may not do anything sensible. If you define your own class > and do NOT override the toString() inherited from the Object > class your output will only be the class name followed by the > output of the hashCode() method for your class. But the java SDK API docs recommend exactly that for every class, you override this behavior inherited from Object, wherever some other toString() implementation makes more sense for your object, which is why I consider this to be an implied contract. If you don't keep the contract, and go with the default, you deserve the results, it seems to me. In any case, such universal meta-programming rules would seem useful for Ada, beyond just the idea of a style guide. Do such exist? Does a repository of them exist? xanthian. -- Posted via Mailgate.ORG Server - http://www.Mailgate.ORG