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!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!feed2.news.rcn.net!rcn!feed3.news.rcn.net!not-for-mail Sender: jsa@rigel.goldenthreadtech.com Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request References: <49dc98cf.0408110556.18ae7df@posting.google.com> <6F2Yc.848$8d1.621@newsread2.news.pas.earthlink.net> <87eklg62x8.fsf@news.bourguet.org> From: jayessay Organization: Tangible Date: 07 Sep 2004 11:13:55 -0400 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: DXC=9PiK^37 Georg Bauhaus writes: > jayessay wrote: > > : Not if the testing is the sort used in bottom-up dynamic incremental > : development. There you are often testing both the "type constraints" > : _and_ logic at the subexpression level up through clause and finally > : to function! This is way earlier and faster than any static type > : checking. It is also more robust as it is checking a lot more over a > : far greater set of code paths. > > It isn't surprising that testing checks more than static type checking > alone. I don't know, has anybody suggested that static type checking > is to be used alone? No. But the point is with static typing you lose this sort of dynamic incremental development. See my other post on this (reply to you). > When you are testing "type constraints", how is that different from > a compiler testing type constraints at compile time? Because you don't need to set up an entire boiler plate to test one thing and then go throug a compile-link-execute-edit-again cycle. Further, you are simultaneously testing the logic. > What do you mean by robust? Both type checks and logic errors are checked simultaneously and at very fine grained levels. > 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. > 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_. Anyway here's a couple of ways to achieve the same _typing_ constraint [1] (defun any (x) (assert x any-type "a value of type any-type") (let ((result ...)) ... (assert result N "a return value of type N") result)) (declaim (ftype (function (a-type) N) foo)) (defun any (x) ...) /Jon [1] I think you are getting confused into thinking Lisp is somehow not typed simply because it doesn't have static typing. It is actually very strongly typed - actually stronger than Ada as there is no equivalent of Unchecked_Conversion. All _values_ have a type and that cannot be changed. -- 'j' - a n t h o n y at romeo/charley/november com