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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,335027991b3a97ec X-Google-Attributes: gid103376,public From: rlk@rational.com (Bob Kitzberger) Subject: Re: Debug code Date: 1996/03/15 Message-ID: <4icema$opi@rational.rational.com>#1/1 X-Deja-AN: 142900613 references: <1996Mar14.223326.13730@nosc.mil> organization: Rational Software Corporation newsgroups: comp.lang.ada Date: 1996-03-15T00:00:00+00:00 List-Id: Kelly J. Grant (grantk@manta.nosc.mil) wrote: : I'm also a big fan of providing methods like Show( title, value ), : with overloads for various types to use for displaying values, such as : integer, string and boolean. Leave all this code in during : development, and when you deliver, you could replace the package debug : body with no-op functions (with a pragma INLINE), and you then won't : pay a performance penalty. It is also handy to add a defaulted parameter : at the end with a boolean to indicate whether or not to add a new_line : for times when you want multiple values on the same line. Along a similar vein... I find it useful to define a Image function for ADTs: package Pencil is type Object is private; function Image( The_Object : Object ) return String; ... Force of habit, it usually only takes a minute to write an Image function for a new ADT, and it comes in surprisingly handy for inclusion in a debug setup like you describe above. I find defining a function that returns a string is more flexible than defining a subprogram that writes to stdout, e.g. -- Bob Kitzberger Rational Software Corporation rlk@rational.com