Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Stefan Monnier <monnier+/news/lists/caml@TEQUILA.SYSTEMSZ.CS.YALE.EDU>
To: caml-list@inria.fr
Subject: Re: pattern matching
Date: 06 May 1997 15:59:37 -0400	[thread overview]
Message-ID: <5lpvv45q3a.fsf@tequila.systemsz.cs.yale.edu> (raw)
In-Reply-To: <336F3968.B7CF7F8@lannion.cnet.fr>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1367 bytes --]

Olivier Montanuy <montanuy@lannion.cnet.fr> writes:
> > Par ailleurs, il arrive quelquefois que l'on fasse volontairement des
> > pattern-matching incomplets, parce que le programme est tel que les
> > cas non fournis ne peuvent arriver. 
> Un programme, ca evolue, et ce qui est vrai aujourd'hui risque de
> ne plus l'etre si une autre personne doit retoucher le code.

Pour ces cas là, il serait bien d'avoir une analyse suffisante qui détermine
"oh, ben, dit donc, il manque un cas dans le pattern-matching, mais c'est un
cas impossible alors j'vais rien dire". Comme ça, on évite les warnings (pour
autant que l'analyse est suffisamment maline) mon on a quand même
l'avertissement si qqun change le code.

Un tel système avait plus ou moins été développé pour SML/NJ sous le nom de
refinement-types (quoi que c'était pas tout à fait automatique).

Le compilateur Scheme "Stalin" utilise aussi un système similaire pour
déterminer quelle représentation choisir (éviter les tags quand ils ne
sont pas nécessaires).


        Stefan

-------------------
Version anglophone:

Freeman's refinement-types and other less-sophisticated analysis can get you
the best of both worlds by figuring out that a warning is not necessary
(because the case cannot happen) so that if you change the code, the warning
will reappear if the case becomes possible.


        Stefan





  reply	other threads:[~1997-05-07  9:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-01 13:34 stderr David Monniaux
1997-05-06 10:37 ` stderr Christian Boos
1997-05-11 15:53   ` stderr Dave Mason
1997-05-13 16:32     ` stderr Pierpaolo Bernardi
1997-05-06 14:03 ` pattern matching Olivier Montanuy
1997-05-06 19:59   ` Stefan Monnier [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-09-05 17:19 Pattern Matching Ernesto Posse
1996-09-06  8:17 ` Pierre Weis
1996-09-06  9:20 ` Frank Christoph

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=5lpvv45q3a.fsf@tequila.systemsz.cs.yale.edu \
    --to=monnier+/news/lists/caml@tequila.systemsz.cs.yale.edu \
    --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