Re: Enumerated data types

dik@cwi.nl (Dik T. Winter)
27 Aug 90 19:39:24 GMT

          From comp.compilers

Related articles
Enumerated data types mandel@forwiss.uni-passau.de (1990-08-23)
Re: Enumerated data types moss@cs.umass.edu (1990-08-24)
Re: Enumerated data types skrenta@amix.commodore.com (1990-08-15)
Re: Enumerated data types dik@cwi.nl (1990-08-24)
Re: Enumerated data types ok@goanna.cs.rmit.OZ.AU (1990-08-27)
Re: Enumerated data types jejones@microware.com (1990-08-27)
Re: Enumerated data types perelgut@turing.toronto.edu (1990-08-24)
Re: Enumerated data types dik@cwi.nl (1990-08-27)
Re: Enumerated data types grover@brahmand.Eng.Sun.COM (1990-08-28)
Re: Enumerated data types corbett@lupa.Eng.Sun.COM (1990-08-29)
Re: Enumerated data types pjj@cs.man.ac.uk (Pete Jinks) (1990-08-29)
Re: Enumerated data types kurt@tc.fluke.COM (1990-08-29)
Re: Enumerated data types anw@maths.nott.ac.uk (1990-08-29)
| List of all articles for this month |
Newsgroups: comp.compilers
From: dik@cwi.nl (Dik T. Winter)
Keywords: Algol68, design, Ada
Organization: CWI, Amsterdam
References: <1990Aug23.134826.2865@forwiss.uni-passau.de> <3621@goanna.cs.rmit.oz.au>
Date: 27 Aug 90 19:39:24 GMT



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
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.