Path: utzoo!attcan!uunet!mcvax!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.lang.misc Subject: Re: What is B&D? (Re: Bondage and Discipline Languages) Message-ID: <4267@enea.se> Date: 24 Jan 89 22:45:33 GMT Organization: ENEA DATA AB, Sweden Lines: 37 David Gudeman (gudeman@arizona.edu) writes: >Kevin S. Van Horn (kevin@cit-vax.Caltech.Edu) writes: >>Give me a break! What's so horribly difficult and inconvenient about writing >>x.f1 when you want to use x as a variable of type t1, and x.f2 when you want >>to use it as a variable of type t2? Gudeman goes on with with various objections that this is "inconvenient". Before I comment that, let me first say I find this of less interest in this case; variant records as a mean of conversion in Pascal and Modula. Inconvenient or not - it's certainly not a good method. When you are using x.f1 and x.f2 you are far away from the declaration and you don't see that you are referring to the same field. And to make it even more fun: it's compiler dependent too. Look at: CASE boolean OF true : (ch1, ch2, ch3, ch4 : char); false : (int : integer); END; In which order the chars are allocated is up to the compiler to decide. >Maybe _you_ want language designers protecting you from yourself, but >I can get along fine without their help. ... >But _I_ still don't want such practices forced >on me by my programming language. (And lot of similar deleted.) You may not want to be protected, and you if write code for your very own private use, there's no problem. But if I were your boss, I'm sorry, I'd prefer you waste some extra time and money with those small "inconveniences" (I'm not talking variant records here, rather Ada style or type-cast operator a la VAX-Pascal) than have to pay a lot more money due to the mistakes you made because there was no type checking. -- Erland Sommarskog ENEA Data, Stockholm This signature is not to be quoted. sommar@enea.se