-- I appreciate all of the extra Ada capabilities that you have learned. -- It is all good stuff. -- Still, you have not incorporated many of the features for reusability that -- I requested, chiefly the use of a generic function for inputting the -- number (look at my comments for the first version). -- Also please change the name from DIGIT to something indicating a -- number between -32768 and 32767, as you define it. -- Please change the parameter string to include the entire output -- string to generalize the procedure somewhat. -- G. Levine From: Eugene Giuliano To: Dr Levine levine@alpha.fdu.edu Dr Levine, Mailed under separate heading, is the second implementation of my CALCULATOR program in Ada. I have implemented as many of your suggestions as my Ada abilities permit. Below are some comments. GENERAL COMMENTS: PLATFORM: Develpment was done using VAX/VMS Ada. The file naming convention observed for a SPEC was to use an "_" instead of a .abs extention, as per GEC's internal convention. STYLE: I have formatted the code to be consistant (I think) with the style guide. This was accomplished with the aid of an automated formatter - a.pr. The utility is part of the VADS Ada development package and is hosted on a MIPS Unix platform. I will discuss this it real-time with you. A handy utility like this would be quite useful for our purposes. Perhaps one is available in the public domain. EXTERNAL MODULES: I have maintained the one module per file implementation for now. Your comments about internalizing non-reusable modules are most appropiate and are understood and accepted. My original approach is based on a Fortran mindset. Clearly, proper Ada development requires a more modern approach that I must adopt. My approach actually complicated the development since the order of compilation became critical. This was an interesting learning experience with the DEC Ada toolset. SPECIFIC COMMENTS GET_FIRST_DIGIT was "generalized" (modified) to accept a string parameter for the prompt and GET_SECOND_DIGIT was eliminated. PERFORM_OPERATION was fixed to use Exceptions and CHECK_DIVISOR was eliminated. I am hesitating to make this a function since the caller should NOT print a result if there is an error. PACKAGE CAL_FUNCTION and the related spec were implemented to give me some experience with this feature of the language. GENERIC implementation is there in a half-baked way. At first I tried to develop CALCULATOR to handle any number type e.g. floating, integer, subtype. This lead to all kinds of problems and a lot of trouble. -- Look at my code in the previous example, and send me your -- work, even if it is half baked. That is the only way to learn. I enlisted an Ada guru at one point to assist me. Eventually I (we) abandoned the approach since it was impossible to instantionate TEXT_IO.INTEGER with a private type. -- You do not use a private type; you use a numeric type. -- generic -- type NUMBER is range <>; -- Check my code. I also experienced problems with the relational (/=) and mathimatical operators (+,/,*,-). Frustrating and very time consuming. A re-match is scheduled for the next incarnation of CALCULATOR. SIMPLE HEADERS were placed in all the files.