Title option parser: make keywords mandatory
Priority wish Status chatting
Superseder Nosy List florian, jendrik, malte
Assigned To Keywords
Optional summary

Created on 2015-01-04.17:58:13 by jendrik, last changed by jendrik.

msg6166 (view) Author: florian Date: 2017-03-09.20:42:50
The bug is now issue711.
msg6164 (view) Author: malte Date: 2017-03-09.15:45:22
Unlike Jendrik's example, where ff() matches the first positional argument and
cea() the second one, this example should really be an error, as "max" only
takes a single argument.

Do we silently swallow additional arguments? It looks like we do, at least for
max(), but probably across the board. This is a bug different from the wish in
this issue, and it would be great if you could open an issue for it mentioning
the "max(h1, h2)" example. Here is an example of something that the option
parser accepts but shouldn't:

./ ../benchmarks/blocks/probBLOCKS-4-0.pddl --search
"astar(max(ff(), cea()))"
msg6163 (view) Author: florian Date: 2017-03-09.09:21:59
Another tricky example for this is "max(h1, h2)" which actually computes
max([h1]) = h1.
msg3992 (view) Author: jendrik Date: 2015-01-04.17:58:13
Originally this issue was posted in the discussion of issue288, but we decided to split it off into a separate 

Jendrik originally posted:

We stumbled over a parser subtlety. I'll use a config that is present 
in the master branch to demonstrate:

When a user wants to run lazy_greedy with ff() and cea() he might forget the 
square brackets:

./downward-release --search "lazy_greedy(ff(), cea())"

The parser happily accepts this and cea() is used to calculate preferred 
operators. We should maybe think about ways to prevent such subtle usage 

Malte commented:

If we want to borrow additional ideas from Python, Python has "keyword-only"
arguments, which also solve the problem of not changing meaning if additional
options are added. For the large majority of options, we by convention always
use the keyword form anyway. Depending on the type of object, we usually use the
non-keyword positional form only for 0-1 arguments. Maybe keyword-only should be
the default and possibly positional arguments should be the special case.
Date User Action Args
2017-04-21 18:13:28jendriksettitle: avoid subtle usage errors by making parser more rigorous -> option parser: make keywords mandatory
2017-03-09 20:42:50floriansetmessages: + msg6166
2017-03-09 15:45:22maltesetmessages: + msg6164
2017-03-09 09:21:59floriansetstatus: unread -> chatting
nosy: + florian
messages: + msg6163
2015-01-04 17:58:13jendrikcreate