From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA10484; Fri, 30 Aug 2002 17:56:50 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA10755 for ; Fri, 30 Aug 2002 17:56:48 +0200 (MET DST) Received: from mg.ihep.su (mg.ihep.su [194.190.161.38]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g7UFcxD05253 for ; Fri, 30 Aug 2002 17:39:15 +0200 (MET DST) Received: by mg.ihep.su (Postfix, from userid 65436) id 699D2B535C; Fri, 30 Aug 2002 19:38:58 +0400 (MSD) Received: from ontil.ihep.su (ontil.ihep.su [194.190.161.63]) by mg.ihep.su (Postfix) with ESMTP id 9DAEBB511A; Fri, 30 Aug 2002 19:38:57 +0400 (MSD) Received: from localhost (vsl@localhost) by ontil.ihep.su (8.11.6/8.11.6) with ESMTP id g7UFcLx04209; Fri, 30 Aug 2002 19:38:21 +0400 Date: Fri, 30 Aug 2002 19:38:21 +0400 (MSD) From: Vitaly Lugovsky To: David Frese Cc: Caml-list Subject: Re: [Caml-list] Q: safe language In-Reply-To: <1030719022.1831.32.camel@pc-6> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On 30 Aug 2002, David Frese wrote: > > > > (cadr '(1)) > > > > > > This shows that Lisp is safe, because it results in an error, and does > > > not return some value from out of nowhere (or does it). > > > > No. In this place program may be expecting some structure, which can > > contain NIL. There is no other way in lisp to define structures - so, any > > code accepting lists will accept any alien structure. Is is type safety? > > If you are refering to the fact, that the expression above returns NIL, > then yes, this is no type-safety, and a very bad thing - I did not know > that. It depends on the Lisp implementation. But, you can find a lot of "unsafe" examples with correct behavior: e.g. 3-d vector passed as 2-d vector, and lisp function working with structures using only cars and cdrs will not fail with it. > > No way! Dynamically typed languages can't be safe. > > I don't think this is a problem of dynamic or static typing, but a mad > behaviour of Lisp. With polymorphism and dymanic typing the programm may not fail at the point where wrong type was passed - and this is "unsafe" behaviour (this is where I have an ugly headache with Java). Statically typed language will not allow potentially unsafe function calls. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners