Path: utzoo!attcan!uunet!mcsun!ukc!newcastle.ac.uk!turing!ncmh From: Chris.Holt@newcastle.ac.uk (Chris Holt) Newsgroups: comp.lang.misc Subject: REFs or aliases? (was Re: C's sins of commission) Message-ID: <1990Oct28.165903.9627@newcastle.ac.uk> Date: 28 Oct 90 16:59:03 GMT References: <2062@aber-cs.UUCP> <1990Oct26.155937.29185@maths.nott.ac.uk> Sender: news@newcastle.ac.uk Organization: Computing Laboratory, U of Newcastle upon Tyne, UK NE1 7RU. Lines: 27 All this discussion about Pointers considered Harmful seems to come down to the following: In article <1990Oct26.155937.29185@maths.nott.ac.uk> anw@maths.nott.ac.uk (Dr A. N. Walker) writes: > But in almost every programming language, in addition to values >of type INT, I have to deal with values of type REF INT (integer variables >in most languages). Yes, it complicates life, but it's usually thought >to be worth it. That's the point ( :-); is it really worth it? What constraints should be placed on REFs so that they don't allow arbitrary firewall failures (as in another thread)? What operations should be allowed on REFs? Arithmetic seems dangerous; but if you don't have even that, then pointers have no advantage over aliasing (and when you don't need aliasing, you don't need pointers). > Extending to REF REF INT (pointers), and other REF types, >generalises and simplifies the construct. It's just a shame that so many >programmers fail to appreciate this (often because their first language >managed to muddy the waters). Like Algol 68? ----------------------------------------------------------------------------- Chris.Holt@newcastle.ac.uk Computing Lab, U of Newcastle upon Tyne, UK ----------------------------------------------------------------------------- "Who overcomes by reason sole hath overcome but half his foe..."