Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!mcsun!ukc!stl!news From: news@stl.stc.co.uk (News admin c/o dww) Newsgroups: comp.lang.misc Subject: Re: bizarre instructions Message-ID: <4100@stl.stc.co.uk> Date: 1 Mar 91 11:26:18 GMT References: <1991Feb25.194658.3712@linus.mitre.org> Reply-To: tom@nw.stl.stc.co.uk Organization: STC Technology Ltd., Harlow, Essex, GB Lines: 31 From:tom@nw.stl.stc.co.uk > I have never seen any language description in which the type of the > result in a replacement statement affected what operation is > performed. There are quite a few such languages. In the dialect of Algol we use here for writing operating systems (and much else) it's easy to give an example. Let's suppose that R1 and R2 are floating point variables, and I1 and I2 are integer variables. Now look at two statements A: R1:= I2+R2 B: I1:= I2+R2 These are replacement statements. The type of the result in the first is float, in the second it's integer. In the first I2 is floated and a floating point add performed. In the second R2 is fixed and an integer addition is performed. Given the ranges allowed for integer and float and the different ways precision may be lost, it seems reasonable to consider the two operations radically different (they even have different failures). This sort of thing arises in every language I know which has implicit coercions. Even in Fortran:- 1 I1 = I2 2 R1 = I2 the statements 1 and two perform different operations (copy and float respectively) just because the result type is different. So what is Prof Rubin trying to say here? Obviously not what he said (he knows Fortran well enough to know that happens). Tom Thomson [tom@nw.stl.stc.co.uk International Computers Ltd, Manchester M12 5DR, UK