From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA13819 for caml-redistribution; Tue, 21 Jan 1997 11:18:59 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA03775 for ; Mon, 20 Jan 1997 21:34:11 +0100 (MET) Received: from Montchapet (root@remote17.ac-dijon.fr [194.167.18.144]) by nez-perce.inria.fr (8.7.6/8.7.3) with SMTP id VAA28092 for ; Mon, 20 Jan 1997 21:34:08 +0100 (MET) Received: from Montchapet (quercia@localhost [127.0.0.1]) by Montchapet (8.6.12/8.6.9) with SMTP id VAA00245 for ; Mon, 20 Jan 1997 21:33:17 GMT Message-ID: <32E3E49B.2467CA18@l-carnot1.ac-dijon.fr> Date: Mon, 20 Jan 1997 21:33:15 +0000 From: Quercia Organization: Lycee Carnot X-Mailer: Mozilla 3.0 (X11; I; Linux 2.0.0 i486) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: ergonomie du compilateur Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: weis > En effet, souvent une erreur de typage intervient à une ligne donnée > pas à cause d'un problème à cette ligne, mais à cause d'un problème à une > ligne antérieure. S'il est souvent assez facile de retrouver où a été typé > un terme, cela devient quelquefois difficile, notamment avec les fonction > récursives, pour le type de la fonction. > Ne pourrait-on pas faire que, sur demande, le compilateur, lorsqu'il > rencontre une erreur de type, ressorte d'où il a inféré les types qui lui > posent problème? Bonne idee ! En attendant, dans ce genre de situation, je place en commentaire (ou je rajoute un failwith "") tous les cas sauf un pour examiner le type de chaque cas. Primaire mais efficace ... > A typing problem in a line of code often happens not because this line is > buggy, but because some previous line is, from which the types of terms i= > the current line have been inferred. Often it's not too difficult to trac= > where those inferences took place, but it's sometimes tedious, especially > with recursive functions. > Couldn't the Ocaml compiler be made to have, on request, more verbose > messages on typing errors, including the trace of inferences of the terms > to cause problems? Good idea ! Meanwhile I comment out (or add a failwith "") every case but one to see the type of the remaining case. Crude but effective ... -- Michel Quercia Lycee Carnot 16 bd Thiers 21000 Dijon e-mail = querciam@l-carnot1.ac-dijon.fr cc = 101702.425@compuserve.com (LG. Vidiani)