NetLogo / NetLogo/NetLogo

That `or` and `and` have equal precedence creates confusion

Open
#1,560 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

compiler engine
Dominant language
Scala
Stars
1.2k
Forks
272
PR merge metrics
No merged PRs in 30d

Description

Apparently or and and are of equal precedence in NetLogo. (See Syntax in Programming Manual.) Also, they are apparently left associative. So

`true` or true and false`

returns false. That produced a bug in my code, which was difficult to track down--and surprising when I got there! I recommend changing to the standard precedence.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Programming Manual's Syntax section linked in the issue and trace how NetLogo parses or and and. Confirm the current left-associative behavior, then determine the project’s parser and compatibility implications; done means standard precedence is implemented and the reported expression behaves as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.