From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id B1700BC0A for ; Fri, 22 Dec 2006 19:45:50 +0100 (CET) Received: from mail20.bluewin.ch (mail20.bluewin.ch [195.186.19.65]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBMIjoTT019275 for ; Fri, 22 Dec 2006 19:45:50 +0100 Received: from [10.0.1.2] (85.1.98.201) by mail20.bluewin.ch (Bluewin 7.3.118) id 457D6BBD0032BD08; Fri, 22 Dec 2006 18:45:50 +0000 In-Reply-To: <1166811403.6555.46.camel@rosella.wigram> References: <6dbd4d000612201941wcd4b09anc503a13889576512@mail.gmail.com> <20061221153413.8f99e8ed.mle+ocaml@mega-nerd.com> <1166685756.5337.4.camel@rosella.wigram> <458A8C7B.7050204@hq.idt.net> <1166709162.5653.11.camel@rosella.wigram> <458AA143.3090303@hq.idt.net> <20061221202520.GG9440@apotheon.com> <20061221221650.GL9440@apotheon.com> <3EC73FC3-41A6-4FB1-9549-29286A6568CC@epfl.ch> <1166811403.6555.46.camel@rosella.wigram> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <4E1EAAC5-DC08-4A55-9AEB-0D5D3BE1C0EA@epfl.ch> Cc: caml-list@yquem.inria.fr Content-Transfer-Encoding: quoted-printable From: =?ISO-8859-1?Q?Daniel_B=FCnzli?= Subject: Re: strong/weak typing terminology (was Re: [Caml-list] Scripting in ocaml) Date: Fri, 22 Dec 2006 19:47:18 +0100 To: skaller X-Mailer: Apple Mail (2.752.2) X-Miltered: at concorde with ID 458C27DE.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bunzli:01 buenzli:01 ocaml:01 ocaml:01 bug:01 abstraction:01 bounded:01 protects:98 arbitrary:01 typing:01 exception:01 exception:01 caml-list:01 data:02 finite:02 Le 22 d=E9c. 06 =E0 19:16, skaller a =E9crit : > It is also unclear what you mean by 'unsafe'. > > Ocaml is not safe: > > let a =3D Array.create 0 0 in > let y =3D a.[99] in (* WOOPS *) > > The fact that an exception is thrown may or may not > make the language safe depending on whether or not > you INTEND to trigger an exception. The best you can > say is that if you don't catch it, its a bug. I'm sorry I don't follow you. =13This would be an example of safety =13=20= according to the definition I gave. Ocaml protects its array =20 abstraction -- which allows to look at a bounded piece of memory as a =20= finite array of values of a certain type --=13 by raising =13an = exception =20 if you try to access out of the bounds of the memory instead of =20 silently =13running the program with the arbitrary data it got by =20 reading out of bounds. Daniel