Remove functions that conflict with Matlab built-ins#1
Open
cwnaber wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 deletes two functions,
isfile.mandstrsplit.m. Both of these functions share a name with a MATLAB built-in function.isfile.misfilefunctions the same as the Matlab built-in (it returns a boolean value), except that the Matlab built-in can return a vector of values for a vector of filepaths. The commonmcode version can only accept a single filepath.isfileon their Matlab Path when they launch the program, they are shown the warning "Warning: Function isfile has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict." each time.strsplit.mstrsplit, except those listed below.doc, callstrsplitwith 4 input parameters. This causes an error if the commonmcode version ofstrsplitis used.Alternatives to deleting the files
Any function in a folder on the Matlab Path will be chosen over a Matlab builtin function. An alternative solution to deleting these files would be to put them in a separate folder. Users could choose to add or not add this separate folder to their Matlab path, depending on if they were using a version of Matlab older than 2017b.
isfilecould be rewritten with a call to the Matlaboutput = dir(filepath), which has existed since 2006b.output.isdiris a boolean describing whether the filepath is a file or not.