Xref: utzoo comp.lang.misc:6981 comp.object:2821 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!sun-barr!ames!vsi1!ubvax!igor!rutabaga!jls From: jls@rutabaga.Rational.COM (Jim Showalter) Newsgroups: comp.lang.misc,comp.object Subject: Re: blip [Re: Dynamic typing -- To Have and Have Not Message-ID: Date: 21 Mar 91 21:40:28 GMT References: <22032@yunexus.YorkU.CA> <11820:Mar1923:59:3591@kramden.acf.nyu.edu> <19MAR91.22493670@uc780.umd.edu> <18271:Mar2013:19:1091@kramden.acf.nyu.edu> <1991Mar20.214231.3411@neon.Stanford.EDU> Sender: news@Rational.COM Followup-To: comp.lang.misc Lines: 37 >The maximum reusability occurs in a system where every piece of >functionality (you may call this "algorithm") is specified EXACTLY >ONCE (i.e. there is no redundancy). This requires that every piece of >code depends ONLY on the abstract interface of its arguments: for >example, a sort routine would work on every collection whose elements >understand < and =. Agreed. >Current type systems are too restricted to allow this, and so you end >up duplicating functionality in many cases. Disagreed. In Ada, for example, you can dynamically instantiate a sort generic with the type and comparison desired, giving you a type model that supports what you want to be able to do. >However, in >dynamically-typed languages such as Self you *can* write e.g. a sort >routine which works for *every* kind of object which understands the >comparison protocol. And you can do this in Ada, too. >Thus, if you design your system correctly, ideal reusability can be >achieved *today* in an untyped language but not in any typed language I >know of. Ada. >It can be achieved partially in languages with genericity. Why only partially? -- ***** DISCLAIMER: The opinions expressed herein are my own. Duh. Like you'd ever be able to find a company (or, for that matter, very many people) with opinions like mine. -- "When I want your opinion, I'll read it in your entrails."