caml-list - the Caml user's mailing list
 help / Atom feed
From: Alain Frisch <>
To: Jacques Garrigue <>
Cc: Enrico Tassi <>, Mailing List OCaml <>
Subject: Re: [Caml-list] How to rename a record field
Date: Fri, 7 Sep 2018 10:36:54 +0200
Message-ID: <> (raw)
In-Reply-To: <>

On 07/09/2018 01:45, Jacques Garrigue wrote:
> Interesting idea.
> This should be easily doable, for instance by extending the Asttypes.arg_label type.

One could also just keep the information on the value binding itself:

   val foo: ?x:int -> ?y:float-> int -> int
      [@@ocaml.deprecated_argument x "Please use y instead!"]
      [@@ocaml.deprecated_missing_argument x "Please pass y, it will 
soon be mandatory"]

Or indeed allow adding attributes on (labeled?) arguments, or interpret 
attributes on their types.  But internally, the information could always 
be attached to the value binding, which should be simpler than storing 
it in the type.

> By deprecating the absence, do you mean having a warning when the argument is ommited?
> Wouldn’t it mean having two distinct deprecation annotations for optional arguments?

Yes, of course.  "Old" attributes (that will be discarded at some point) 
should be reported when they are passed a value; "new" attributes (that 
might become non-optional) should be reported when they are omitted.  It 
remains to be seen what to do with applications with the ?x syntax (i.e. 
passing an option).


Caml-list mailing list.  Subscription management and archives:
Beginner's list:
Bug reports:

  reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06 11:36 Enrico Tassi
2018-09-06 11:40 ` Gabriel Scherer
2018-09-06 13:03   ` Enrico Tassi
2018-09-06 13:17     ` Jacques Garrigue
2018-09-06 14:18       ` Enrico Tassi
2018-09-06 23:35         ` Jacques Garrigue
2018-09-06 16:21 ` Alain Frisch
2018-09-06 16:21   ` Alain Frisch
2018-09-06 23:45     ` Jacques Garrigue
2018-09-07  8:37       ` Alain Frisch [this message]
2018-09-07 10:14         ` Jacques Garrigue
2018-09-07 12:50           ` Alain Frisch

Reply instructions:

You may reply publically 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror

AGPL code for this site: git clone public-inbox