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,b50bc6538a649497 X-Google-Attributes: gid103376,public From: John English Subject: Re: if statements Date: 2000/11/07 Message-ID: <3A0824BB.14ACCA12@bton.ac.uk>#1/1 X-Deja-AN: 690844670 Content-Transfer-Encoding: 7bit References: <3A02CED4.520C2768@brighton.ac.uk> <3A078B6F.D34B024B@erols.com> <8mTN5.7821$pq3.603668@news.flash.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: news@bton.ac.uk X-Trace: saturn.bton.ac.uk 973612242 5900 193.62.183.204 (7 Nov 2000 15:50:42 GMT) Organization: University of Brighton Mime-Version: 1.0 NNTP-Posting-Date: 7 Nov 2000 15:50:42 GMT Newsgroups: comp.lang.ada Date: 2000-11-07T15:50:42+00:00 List-Id: Ken Garlington wrote: > Personally, I would have gone with something more along the lines of > > generic > type Value is private; > with function ">"(A, B : Value) return Boolean is <>; > procedure Homework_Assignment(A, B : in out Value); > > -- Exchange is defined in the Ada Reference Manual > with Exchange; > procedure Homework_Assignment(A, B : in out Value) is > procedure Swap is new Exchange(Value); > begin > if A > B then > Swap(A,B); > end if; > end Homework_Assignment; > > Can't you imagine how pleased the instructor will be to find out that the > student has already mastered generics? Unfortunately this sort of question gets marked by an automated system, so the robotic instructor in question will, I'm afraid, be deeply unimpressed. ;-) ----------------------------------------------------------------- John English | mailto:je@brighton.ac.uk Senior Lecturer | http://www.it.bton.ac.uk/staff/je Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS ** University of Brighton | -- see http://burks.bton.ac.uk -----------------------------------------------------------------