* Feature wish: to omit explicit coercion for mli's
@ 2005-11-21 9:35 Keiko Nakata
2005-11-21 9:46 ` [Caml-list] " Oliver Bandel
0 siblings, 1 reply; 3+ messages in thread
From: Keiko Nakata @ 2005-11-21 9:35 UTC (permalink / raw)
To: caml-list
Hello,
it would be nice if I can omit explicit type coercion
to match .ml files with .mli's.
For instance, the following obj.ml does not match with obj.mli.
in obj.ml:
let o = object method f1 = 1 method f2 = 2 end
in obj.mli:
val o : < f1 : int >
Explicit coercion would make the type system efficient.
However, I suppose that only inferring coercion when checking
that .ml's meet .mli 's does not have much effect.
Regards,
Keiko NAKATA
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] Feature wish: to omit explicit coercion for mli's
2005-11-21 9:35 Feature wish: to omit explicit coercion for mli's Keiko Nakata
@ 2005-11-21 9:46 ` Oliver Bandel
2005-11-21 12:55 ` Keiko Nakata
0 siblings, 1 reply; 3+ messages in thread
From: Oliver Bandel @ 2005-11-21 9:46 UTC (permalink / raw)
To: caml-list
On Mon, Nov 21, 2005 at 06:35:30PM +0900, Keiko Nakata wrote:
> Hello,
>
> it would be nice if I can omit explicit type coercion
> to match .ml files with .mli's.
>
> For instance, the following obj.ml does not match with obj.mli.
Your feature wish is a bug-wish. ;-)
If *.ml and *.mli do not match, then you have written
code that better would be rewritten, to say it nicely. ;-)
Ciao,
Oliver
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] Feature wish: to omit explicit coercion for mli's
2005-11-21 9:46 ` [Caml-list] " Oliver Bandel
@ 2005-11-21 12:55 ` Keiko Nakata
0 siblings, 0 replies; 3+ messages in thread
From: Keiko Nakata @ 2005-11-21 12:55 UTC (permalink / raw)
To: oliver; +Cc: caml-list
From: Oliver Bandel <oliver@first.in-berlin.de>
> If *.ml and *.mli do not match, then you have written
> code that better would be rewritten, to say it nicely. ;-)
I do not think this is a bug-wish.
ob.ml would match with ob.mli by inserting explicit coercion as in :
in ob.ml:
let o = (object method f1 = 1 method f2 = 2 end :> < f1 : int >)
in ob.mli:
val o : < f1 : int >
I thought that this explicit coercion can be suppressed
with little inefficiency of the type checker.
I occasionally use immediate objects to build polymorphic objects
without writing type annotations.
(I mean, if I build polymorphic objects through class definitions,
I may need to define the classes with many type parameters.)
For the same reason, I thought that it would be nice
if I could omit explicit coercion in some cases
when it does not cause inefficiency a lot.
Regards,
Keiko
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-11-21 12:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-21 9:35 Feature wish: to omit explicit coercion for mli's Keiko Nakata
2005-11-21 9:46 ` [Caml-list] " Oliver Bandel
2005-11-21 12:55 ` Keiko Nakata
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox