Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!apple!snorkelwacker!husc6!spdcc!esegue!compilers-sender From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.compilers Subject: Re: Enumerated data types Keywords: Algol68, design, Ada Message-ID: <2019@charon.cwi.nl> Date: 27 Aug 90 19:39:24 GMT References: <1990Aug23.134826.2865@forwiss.uni-passau.de> <3621@goanna.cs.rmit.oz.au> Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: dik@cwi.nl (Dik T. Winter) Organization: CWI, Amsterdam Lines: 21 Approved: compilers@esegue.segue.boston.ma.us In article <3621@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.OZ.AU (Richard A. O'Keefe) writes: > The thing which made overloading tricky in Algol 68 was that Algol 68 > combined overloading with automatic coercions. Ada doesn't go in for > automatic coercion. That is incorrect. Algol 68 allows overloading for operators only, and coercions are not performed on operands of operators. For instance in the context of: 'proc'('real','int')'real' + = ('real' r, 'int' i)'real': .... the expression 1.0 + 1.0 can still not be resolved, i.e. widening does not take place. Similar for other coercions. The only kind of coercions allowed for operands is 'dereferencing', but that is common to other languages (and implicitly also in Ada). Ada is much trickier because overloading not only depends on operand types (as in Algol 68) but also on result type. -- dik t. winter, cwi, amsterdam, nederland dik@cwi.nl -- Send compilers articles to compilers@esegue.segue.boston.ma.us {ima | spdcc | world}!esegue. Meta-mail to compilers-request@esegue.