Skip to content

Conversation

@rocky
Copy link
Member

@rocky rocky commented Sep 17, 2020

From #645:

Currently, if options are given for commands that are not supported, they are simply ignored. This can be very confusing for novice users, especially if they mistype an option (e.g. FieldSeperetors instead of FieldSeparators).

This PR adds a new meta option called $OptionSyntax that may be either Strict, Warn or Ignore, and defines what should happen, if the user specifies an option that does not show up in the Builtin's options dictionary.

The default (also used if no $OptionSyntax is specified) is to give a warning but continue with evaluation. Strict gives a warning and stops the evaluation (this happens for Plot). Ignore is the old behavior.

In addition to this, this PR adds custom checks for Import and Export that gives warnings for options that are not supported by the import/export plugin.

In this current form, Import, Export and other commands will warn about unused options, which might differ from MMA. Still, I think these kinds of warnings are so useful that we should accept their general existence in Mathics. In addition, some commands, like Plot, really want to abort evaluation, if non-supported options are given, and this PR offers a solution for not having to code this checks for each single Builtin that wants to behave in that way.

@GarkGarcia GarkGarcia merged commit 6b96edd into mathics:master Sep 17, 2020
@rocky rocky deleted the opterr branch September 17, 2020 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants