caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Quercia <querciam@l-carnot1.ac-dijon.fr>
To: caml-list@inria.fr
Subject: Re: ergonomie du compilateur
Date: Mon, 20 Jan 1997 21:33:15 +0000	[thread overview]
Message-ID: <32E3E49B.2467CA18@l-carnot1.ac-dijon.fr> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1500 bytes --]

> 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)





             reply	other threads:[~1997-01-21 10:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-20 21:33 Quercia [this message]
1997-01-21  9:10 ` Pierre Weis
1997-01-21 10:31 ` Emmanuel Engel
  -- strict thread matches above, loose matches on Subject: below --
1997-01-22 17:17 David Gurr
1997-01-23 14:18 ` Frank Christoph
1997-01-24  2:51   ` Jacques GARRIGUE
1997-01-15  9:46 David Monniaux
1997-01-21 10:33 ` Xavier Leroy
1997-01-21 10:35 ` Claude Marche
1997-01-21 12:54 ` Hendrik Tews
1997-01-23 16:37   ` Ian T Zimmerman
1997-01-30  9:55   ` Xavier Leroy
1997-01-31 14:21     ` Donald Syme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32E3E49B.2467CA18@l-carnot1.ac-dijon.fr \
    --to=querciam@l-carnot1.ac-dijon.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).