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 OAA30678; Wed, 22 Sep 2004 14:50:51 +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 OAA29770 for ; Wed, 22 Sep 2004 14:50:45 +0200 (MET DST) Received: from sl.pt (mail.sl.pt [212.55.140.13]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i8MCoibZ008265 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=FAIL) for ; Wed, 22 Sep 2004 14:50:45 +0200 Received: (qmail 4084 invoked from network); 22 Sep 2004 12:50:37 -0000 Received: from unknown (HELO link.sapo.local) (cvalente@sl.pt@[172.28.230.61]) (envelope-sender ) by mail.sl.pt (qmail-ldap-1.03) with RC4-MD5 encrypted SMTP for ; 22 Sep 2004 12:50:37 -0000 From: =?utf-8?q?Cl=C3=A1udio_Valente?= Reply-To: cvalente@co.sapo.pt Organization: SAPO To: "Marcin 'Qrczak' Kowalczyk" Subject: Re: [Caml-list] Re: OCAML Downcasting? Date: Wed, 22 Sep 2004 13:50:36 +0100 User-Agent: KMail/1.7 Cc: skaller@users.sourceforge.net, caml-list References: <1095819964.2580.1016.camel@pelican.wigram> <87d60eizlh.fsf@qrnik.zagroda> In-Reply-To: <87d60eizlh.fsf@qrnik.zagroda> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <200409221350.36436.cvalente@co.sapo.pt> X-Miltered: at concorde with ID 41517524.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; sapo:99 caml-list:01 downcasting:01 2004:99 marcin:01 'qrczak':01 kowalczyk:01 statically:01 checkers:01 gcc:01 gcc:01 const:01 ocaml:01 int:01 int:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Em Quarta, 22 de Setembro de 2004 07:31, o Marcin 'Qrczak' Kowalczyk escrev= eu: > And guess what? No language I know checks division by 0 statically > (except proof checkers, but they are not suitable for writing big > programs - too much work) 12>0 cvalente@link Stats 54$ cat t.pl sub t{ print 1/0; } 13>0 cvalente@link Stats 54$ perl -c t.pl Illegal division by zero at t.pl line 2. perl -c stands for check syntax gcc also has this. It gives a warning gcc -c t.c t.c: In function `t': t.c:2: warning: division by zero and it does even more: 24>0 cvalente@link Stats 54$ cat t.cpp const int X =3D 1-1; int t(int i){ return i/X; } 25>0 cvalente@link Stats 54$ g++ -c t.cpp t.cpp: In function `int t(int)': t.cpp:3: warning: division by zero in `i / 0' These are not exhaustive tests, but they are good enough to catch many comm= on=20 errors. =2D-=20 Cl=C3=A1udio Valente ------------------- 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