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

disable make without explicit 1st-arg type, like make(2, 3) #5

Merged
merged 1 commit into from
Jul 15, 2019

Conversation

rfourquet
Copy link
Member

Having the shortcut make(2, 3) for make(Array, 2, 3), which mirrors
rand(2, 3), is convenient, but the form make(Int, 2, 3) leads to
ambiguities for types which take 2 integer args, e.g.
make(MyType, 2, 3). Let's favor simplicity for custom-defined types.

Moreover, the terminology "make" makes sense when the first arg
refers to the type to be "made", e.g. in make(Int, 2, 3) we didn't
make an Int, but an array, so the meaning of "make" was lost.

@rfourquet rfourquet added the breaking this is a breaking change label Jul 13, 2019
Having the shortcut `make(2, 3)` for `make(Array, 2, 3)`, which mirrors
`rand(2, 3)`, is convenient, but the form `make(Int, 2, 3)` leads to
ambiguities for types which take 2 integer args, e.g.
`make(MyType, 2, 3)`. Let's favor simplicity for custom-defined types.

Moreover,  the terminology "make" makes sense when the first arg
refers to the type to be "made", e.g. in `make(Int, 2, 3)` we didn't
make an `Int`, but an array, so the meaning of "make" was lost.
@rfourquet rfourquet merged commit 8cdc98a into master Jul 15, 2019
@rfourquet rfourquet deleted the remove-shortcuts branch July 15, 2019 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking this is a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant