Confusing error when missing arg on prim that takes repeatable final arg
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 1.2k
- Forks
- 272
- PR merge metrics
- No merged PRs in 30d
Description
The run prim takes a string or a command task along with an optional repeatable final arg for values to provide to the task. If you forget the first arg you get a slightly confusing message:
observer> run
ERROR: RUN expected at least 1 input, a string or anonymous command and any input.
Both sides of the comma are correct there, but together they don't make sense unless you understand a lot about NetLogo primitive arguments.
The straightforward fix seems to be adding the extra information about the final value being ...and any input to ...zero or more input values; essentially providing the information that it's a repeatable type and not required. The issue there is that many prims, especially extension prims, use RepeatableType as an optional type arg, because NetLogo only provides OptionalType for command blocks. As such if we update the message to be zero or more it becomes confusing for prims like csv:to-file which takes an optional delimiter argument as a repeatable.
Maybe the fix is just to add the zero or more ... values for now as the error message will at least be a little clearer and then later on get the OptionalType properly working with other arg types so it can be 100% accurate.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the run primitive formats its missing-argument error and how RepeatableType and OptionalType are represented. Compare the behavior with csv:to-file, then verify that any revised wording is clearer for run without misdescribing optional repeatable arguments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100