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,4b862d91ff93feff X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Text_IO for other standard types Date: 1998/01/17 Message-ID: #1/1 X-Deja-AN: 316865999 References: <98011512220569@psavax.pwfl.com> <69q6k3$8fk$1@peuplier.wanadoo.fr> X-Complaints-To: usenet@news.nyu.edu X-Trace: news.nyu.edu 885059026 30913 (None) 128.122.140.58 Organization: New York University Newsgroups: comp.lang.ada Date: 1998-01-17T00:00:00+00:00 List-Id: JPR says <<> > (And, P.S.: Try explaining generic instantiation to a room full of > non-programming engineers just so you can do simple I/O exercises > with them and see how difficult this is! It's not. Just give it as a "cooking recipe". The first day, I explain that to get IO's on type Counter, they have to use the magic formula: package Counter_IO is new Integer_IO (Counter); and that they will later discover why (I don't even tell it's a generic instanciation). People accept it without problems. >> I strongly dislike the magic cooking recipe approach. Yes, you can get students to accept it, but in my opinion damage is done since you compromise the critical principle that people should understand what they are doing. Fortunately, there is a perfectly comfortable way to deal with this, which is to use the Image attribute, so people can write My_Type'Image (val) Sure, you don't get nice formatting that way, but you can leave nice formatting for later. Note that the extension of Image to cover floating-point types is a nice improvement for this style of teaching. This is certainly not a big deal, but I see no reason for introducing magic cookbook formulae when it is unnecessary.