From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c406e0c4a6eb74ed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!newsfeed.stueberl.de!news-mue1.dfn.de!news-ham1.dfn.de!news.uni-hamburg.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request Date: Tue, 7 Sep 2004 15:57:37 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <49dc98cf.0408110556.18ae7df@posting.google.com> <6F2Yc.848$8d1.621@newsread2.news.pas.earthlink.net> <87eklg62x8.fsf@news.bourguet.org> NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1094572657 24271 134.91.1.34 (7 Sep 2004 15:57:37 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Tue, 7 Sep 2004 15:57:37 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: g2news1.google.com comp.lang.ada:3440 Date: 2004-09-07T15:57:37+00:00 List-Id: jayessay wrote: : Georg Bauhaus writes: :> What do you mean by robust? : : Both type checks and logic errors are checked simultaneously and at : very fine grained levels. And static type checking can't add, at least in many relevant cases? :> If a translator sees a function call, where the function has a :> specific formal T parameter, and the translator can do type checking :> before running this piece of the program, doesn't this remove the :> necessity to test a number of code paths in the first place? : : That is often insufficient because it doesn't ensure anything about : whether the _content_ of a value conforming to the type is correct for : the input of the function. Sure it is insufficient. But it adds value by removing the need to test what the compiler has already found out. How about typos? Here is a fake: (defun next (n) (1 + n)) (defun hext (n) (1 + (mod n 16))) ; ... (defun advance (n) (hext n)) ; a slip of the finger (advance 3) 4 Fine. (advance 16) 1 Oops. Types could help I'd say. :> In the following sense, if I have: :> :> (DEFUN ANY (X) ...) ; old LISP :> :> function any(x: T) return N; -- Ada : : "any" seems like an odd name if you don't really want x to be : _anything_. OK, I have chosen the name to be irrelevant, a better name would have been SOME-FUNC. : Anyway here's a couple of ways to achieve the same : _typing_ constraint [1] I know that Lisp values are of a type. But I simply don't see how declaring the type of a function (via arguments), say, can't be a win. What will the ML programmers say? : (assert x any-type "a value of type any-type") : (declaim (ftype (function (a-type) N) foo)) : (defun any (x) ...) Does this hinder incremental testing? -- Georg