cleanup method as function semantic in @list
#2307
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR reverts #2224, and fix some related issue.
We have deprecated the behavior of calling methods as functions directly. Currently, the recommended API design guideline is:
Self
For existing library, library authors need to do nothing: downstream users will receive a deprecated warning when calling methods as function, and fix these usage. There is no need to provide
fnalias
for methods, as in #2224, unless necessary (for example, for math functionsDouble::sin
etc, people are used to regular function syntax due to math notation convention).So this PR reverts #2224, remove
fnalias
for@list.T
methods. Downstream users of@list
will receive a deprecated warning if they use@list.T
methods as regular functions, and it is their responsibility to fix these usage. This is not a breaking change since it's a warning, not a fatal error.One exception is
zip
. Sincezip
is a binary operation on list, it sometimes feels more natural to write@list.zip(xs, ys)
, so thefnalias
forzip
is kept in this PR.cc @illusory0x0 @peter-jerry-ye