Path: utzoo!utgpu!watserv1!watmath!att!rutgers!cs.utexas.edu!asuvax!ncar!ico!haddock!ima!esegue!compilers-sender From: anw@maths.nott.ac.uk (Dr A. N. Walker) Newsgroups: comp.compilers Subject: Re: Enumerated data types Message-ID: <1990Aug29.142641.28548@maths.nott.ac.uk> Date: 29 Aug 90 14:26:41 GMT References: <1990Aug23.134826.2865@forwiss.uni-passau.de> <3621@goanna.cs.rmit.oz.au> <2019@charon.cwi.nl> Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: anw@maths.nott.ac.uk (Dr A. N. Walker) Organization: Maths Dept., Nott'm Univ., UK. Lines: 25 Approved: compilers@esegue.segue.boston.ma.us In article <2019@charon.cwi.nl> dik@cwi.nl (Dik T. Winter) writes: [in Algol] > 'proc'('real','int')'real' + = ('real' r, 'int' i)'real': .... ^^^^^^ 'op' > [...]. The only kind of coercions allowed for operands >is 'dereferencing', [...] Also deproceduring and uniting, but not widening, rowing or voiding. The reason is, of course, to prevent ambiguity -- you are not allowed to overload operators with operands varying [eg] only in the reference levels, but you are with operands varying [eg] only in row levels, so you can disambiguate operands with the wrong reference levels, but not with the wrong row levels. I suspect that at least rowing could have been moved into the other camp [though there may be some subtleties involving the interaction between rows and references], but pragmatically one may well want to overload, in particular, "*" to mean different things for scalars, vectors and matrices. -- Andy Walker, Maths Dept., Nott'm Univ., UK. anw@maths.nott.ac.uk -- Send compilers articles to compilers@esegue.segue.boston.ma.us {ima | spdcc | world}!esegue. Meta-mail to compilers-request@esegue.