Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: boos@gr6.u-strasbg.fr (Christian Boos)
To: Xavier Leroy <Xavier.Leroy@inria.fr>
Cc: caml-list@pauillac.inria.fr
Subject: Error message format (was Re: modules local to functions.)
Date: Wed, 10 Jan 96 18:08:00 +0100	[thread overview]
Message-ID: <9601101708.AA00556@gr6.u-strasbg.fr> (raw)
In-Reply-To: <199601101527.QAA22663@pauillac.inria.fr>



Xavier Leroy writes:
 > Christian Boos replied:
 > 
 > > My understanding is that YOU CAN'T do that in CSL at all: functor
 > > application means code generation, and there's no runtime code
 > > generation!
 > 
 > This is wrong. Functors are compiled once and for all, and functor
 > application proceeds exactly as function application.
 > 

[poor english version]

Hello,

  C++ has twisted my mind...

  I would make a suggestion about the information given by the
compiler when there is a mismatch between an interface and an
implementation.
  Usually, it ends up with something like :

	Values do not match:
	  val f : t1 -> t4 -> t5
	is not included in
	  val f : t1 -> t2 -> t3

	(for example)

  My point is that it would be usefull to be more precise, that is, to
say if the error is with t1 not included in t1, or t4 not included in
t2, ... 

Bye.


--------------------------------------------
Bonjour,

  Autant pour moi ! Ca m'apprendra a raisonner par analogie avec des
langages d'outre-tombe (C++) plutot que de lire le code de CSL avant
de parler ...


  Au passage, je profite de ce mail pour faire une petite suggestion
concernant le message d'erreur genere lorsqu'il y a incompatibilite
entre l'implementation et l'interface d'un module.

  Le message se termine usuellement en donnant une incompatibilite de
type ou une incompatibilite de valeur. Dans le cas des fonctions, ne
pourrait-il pas ajouter la localisation precise de l'erreur ?

  Par exemple, on specifie "sig val f : t1 -> t2 -> t3 end"
et dans l'implementation on construit une fonction f ayant un type
"val f : t1 -> t4 -> t5", avec t4 non compatible avec t2.
  Au lieu de s'arreter dans son message d'erreur a "val f : ... is not
included in val f : ...", il pourrait dire en plus "t4 is not included
in t2".  

 Ceci me semble tres utile car j'ai passe une apres-midi a essayer de
localiser une erreur de ce type, tout simplement parce que dans mon
cas, t4 et t5 etaient des types complexes (generes par des foncteurs)
que j'avais de facon alambiquee contraint a etre egaux a t2 et t3. 
  Je pensais donc que l'erreur venait de la ... alors qu'il s'agissait
d'une erreur toute bete entre t1 et t1 (memes noms, types differents),
erreur qui aurait ete localisee tout de suite si j'avais eu un message
comme en caml-light (la fameuse erreur "This expression has type foo,
but is used with type foo").  


Amicalement,

Christian





  parent reply	other threads:[~1996-01-10 18:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-01-08 12:07 modules local to functions Andrew Conway
1996-01-09  8:04 ` Christian Boos
1996-01-09  9:34   ` Andrew Conway
1996-01-10 15:27 ` Xavier Leroy
1996-01-10 16:22   ` Andrew Conway
1996-01-10 17:08   ` Christian Boos [this message]
1996-02-16 10:12   ` modules local to functions. (again) Christian Boos

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=9601101708.AA00556@gr6.u-strasbg.fr \
    --to=boos@gr6.u-strasbg.fr \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-list@pauillac.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