Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer ?default arguments, instead of ~labelled ones #21

Open
djs55 opened this issue Feb 15, 2015 · 1 comment
Open

Offer ?default arguments, instead of ~labelled ones #21

djs55 opened this issue Feb 15, 2015 · 1 comment

Comments

@djs55
Copy link
Collaborator

djs55 commented Feb 15, 2015

Some of the functions take a metric ton of arguments, most of which have sensible defaults, which someone writing a simple client might not know for sure. The client writer can probably guess, but they shouldn't have to and it makes the code quite unwieldy.

Where the protocol requires an argument, we should generate

let f ?(x = Reasonable_default)

Where the protocol allows an argument to be omitted, we should generate

let f ?x
@gaborigloi
Copy link
Contributor

It might be safer to just make the code break in case we add a new parameter, so that clients will be notified about it, instead of just silently sending the default value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants