Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: malc <malc@pulsesoft.com>
To: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
Cc: caml-list@yquem.inria.fr, skaller@users.sourceforge.net
Subject: Re: [Caml-list] partial application warning unreliable?
Date: Sat, 10 Dec 2005 04:40:46 +0300 (MSK)	[thread overview]
Message-ID: <Pine.LNX.4.61.0512100434130.616@home.oyster.ru> (raw)
In-Reply-To: <20051210.094908.32150993.garrigue@math.nagoya-u.ac.jp>

On Sat, 10 Dec 2005, Jacques Garrigue wrote:

> From: malc <malc@pulsesoft.com>
>
>> I gather all this means that the only "safe" way to call a unit method
>> on an implictily typed object is via:
>>
>> let () = o#moo in ...
>
> Yes, but only if the type of o is unknown.
> If o itself was defined by a let statement, or there was a type
> annotation
>  let f (o : c) = ...
> then the warnings will work properly (fortunately.)

I haven't done that because in my particular case that would have
required recursive modules (and not inside the same source unit).
And having two set of class types that described type of o didn't
really appeal to me all that much.

>
> Personally, I annotate almost all objects received as function
> arguments. It may be seen as defeating the purpose of type inference, but
> this produces better error messages, and avoids the above problem.
> It is also necessary with polymorphic methods or optional arguments.

-- 
mailto:malc@pulsesoft.com


  reply	other threads:[~2005-12-10  1:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-08  2:39 skaller
2005-12-08  3:10 ` [Caml-list] " Jacques Garrigue
2005-12-08  7:11   ` skaller
2005-12-08 14:41     ` Damien Doligez
2005-12-08 23:51   ` malc
2005-12-09  1:43     ` skaller
2005-12-09  2:15       ` Jacques Garrigue
2005-12-09  2:56         ` skaller
2005-12-09 15:26         ` malc
2005-12-10  0:49           ` Jacques Garrigue
2005-12-10  1:40             ` malc [this message]
2005-12-09 12:21       ` Andreas Rossberg
2005-12-09 17:17         ` skaller
2005-12-09 17:52           ` Andrej Bauer
2005-12-09 18:54           ` Andreas Rossberg

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=Pine.LNX.4.61.0512100434130.616@home.oyster.ru \
    --to=malc@pulsesoft.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    --cc=skaller@users.sourceforge.net \
    /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