From ... Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!priapus.visi.com!orange.octanews.net!news.octanews.net!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.e.nsc.no!nsc.no!nextra.com!uio.no!nntp.uio.no!not-for-mail From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: Static/Strong/Implicit Typing Date: 26 Jan 2004 08:11:48 +0000 Organization: Naggum Software, Oslo, Norway Lines: 66 Message-ID: <3284093508521329KL2065E@naggum.no> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: readme.uio.no 1075104709 18903 129.240.65.201 (26 Jan 2004 08:11:49 GMT) X-Complaints-To: abuse@uio.no NNTP-Posting-Date: Mon, 26 Jan 2004 08:11:49 +0000 (UTC) Mail-Copies-To: never User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Xref: archiver1.google.com comp.lang.lisp:10812 * sajiimori | If I were still running a Unix, I'd check out CMUCL -- as it is, I've | only seen CLISP and Corman, neither of which catch type errors at | compile time. :( Would CMUCL warn about this during compile-time? If | not, do you think it should? | | (defun x-plus-y (x y) | (+ x y)) | | (defun test () | (x-plus-y 5 "asdf")) I keep wondering why the static type crowd always make up this kind of examples. In the Common Lisp world, you are supposed to be conscious when you write your code, and the above fragment suggests that you are not, but want the compiler to wake you up from your code-writing coma. One reason to cater to the comatose programmers is that static typing with a wide variety of types adds a lot more things to think about. The other solution to this problem is dynamic typing. If you want to understand what is going on here, you have to begin by realizing that both static and dynamic typing are answers to another, logically preceding question. The static type crowd solved a problem when people passed around machine words with different meanings. «I know», said that static type genius, «I'll let the compiler keep track of all the types and refuse to run the program with values of random types confusing the machine!». In another office, far away, sat the dynamic typing genius and thought «I know, I'll make all values self- determine their types!». The latter genius laid the foundation for the reinvention of object-orientation with run-time type information, which needed to be added to the static type genius's world view at at heavy cost. If you write the above code in Common Lisp, the purpose of running it will be to investigate the response to type errors. You will observe that you invoke the debugger. One of the things you could do then is to realize that the function that was called should be a generic function, and you can back out of the call, redefine the function x-plus-y, and resume execution by retrying the call. Another thing you could do is to realize that you had made a mistake in the caller. In this case, you would back out of the call to test, instead, and redefine that function and resume execution by calling the new test function. Please think about how this is different from the static typing systems you appear to know better than Common Lisp. | So, as a variant of my original question: In a statically, implicitly | typed Lisp, do you think the features would still complement each | other well? As long as you do not understand what you already have, there is no point in answering your question about what would be. And /calm down/, please. Say to yourself that you are not «touchy», and that you have to /think/ when you feel uncomfortable, not lash out at whoever you think makes you feel uncomfortable. Can you do this? -- Erik Naggum | Oslo, Norway 2004-026 Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.