home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.ada
- Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!spool.mu.edu!agate!linus!linus.mitre.org!linus!mbunix!emery
- From: emery@dr_no.mitre.org (David Emery)
- Subject: Re: Programs wanted
- In-Reply-To: pk115050@wvnvms.wvnet.edu's message of 25 Jan 93 18:03:34 EST
- Message-ID: <EMERY.93Jan25205737@dr_no.mitre.org>
- Sender: news@linus.mitre.org (News Service)
- Nntp-Posting-Host: dr-no.mitre.org
- Organization: The Mitre Corp., Bedford, MA.
- References: <1993Jan25.180334.4567@wvnvms.wvnet.edu>
- Date: Tue, 26 Jan 1993 01:57:37 GMT
- Lines: 26
-
- Consider
- package P is
- type I1 is new integer;
- -- "+" now redefined for objects of type I1
- function "+" (l :I1; r : integer) return I1;
- function "+" (l: integer; r : I1) return I1;
- end P;
-
- with P; use P;
- procedure Q is
- X, Y : I1 := 1;
- I, J : Integer := 2;
- MAGIC_NUMBER : constant := 42;
- begin
- X := X + I;
- X := X + 1;
- X := MAGIC_NUMBER + Y;
- Y := X + J;
- I := integer(X) + integer(Y);
- end Q;
-
- How many unique operators are there in this code??? Almost any answer
- to this question involves enough semantic analysis to resolve Ada
- overloading. That's a good-sized chunk of an Ada compiler.
-
- dave
-