Version française
Home     About     Download     Resources     Contact us    
Browse thread
Filename.chop_suffix
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Delahaye <delahaye@j...>
Subject: Filename.chop_suffix
    Bonsoir,

    Je suis tombe, par hasard, sur une phrase du manuel d'ocaml en ligne qui
m'a un peu interpelle (dans Filename):

> val chop_suffix : string -> string -> string
> 
>      chop_suffix name suff removes the suffix suff from the filename name. The
>      behavior is undefined if name does not end with the suffix suff. 

    Cela ressemble fortement a un trou semantique. Pourquoi ne pas lever tout
simplement une exception qui caracteriserait entierement le comportement de
cette fonction?

    Amicalement.

    David.

===============================================================================
David Delahaye                                 <Email>: David.Delahaye@inria.fr
<Laboratory>: The Coq Project                                  <Domain>: Proofs
<Adress>: INRIA-Rocquencourt Domaine de Voluceau BP105 78153 Le Chesnay Cedex
          FRANCE
<Tel>: (33)-(0)1 39 63 57 53
<Fax>: (33)-(0)1 39 63 56 84
<Url>: http://pauillac.inria.fr/~delahaye
===============================================================================

[If you have time to waste, you can have a look on my proof that all the real
 number are positive. Given x in R:

   x^2>=0                 (well-known result)
   (x^2)^(1/2)>=(0)^(1/2) (use of power on each member)
   x^(2*1/2)>=0           (use of the propertie: (x^n)^m=x^(n*m)
   x^1>=0                 (very easy simplification) 
   x>=0                   (great!)]