`and` and `or` precedence in Perl
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- documentation
Research direction
Start at the Ruby Style Guide’s and/or flow section and compare its wording with the linked Perl operator-precedence documentation. Confirm the precedence relationship and revise the paragraph so its comparison is accurate and understandable; done means the explanation no longer contradicts the Perl reference.
Written by the indexing model from the issue text.
Description
Hey there!
I was reading Ruby Style Guide and stumbled upon this paragraph on and/or section:
Also
&&has higher precedence than||, whereasandandorhave the same one. Funny enough, even thoughandandorwere inspired by Perl, they don’t have different precedence in Perl.
English is not my first language, so I re-read this paragraph multiple times, but still could not understand it. If and and or were inspired by Perl, and they do not have different precedence in Perl, and, as far as I understand the examples, they also do not have different precedence in Ruby, then why is it funny?
The paragraph is 4+ years old, and it was probably read multiple times before me, and I though I just could not get the idea behind the wording. So I went to the Perl docs to find out that and and or have different precedence:
Perl operators have the following associativity and precedence, listed from highest precedence to lowest [...]
... nonassoc list operators (rightward) right not left and left or xor
So, I believe I have found an error. If it’s not, can you please explain it to me?
- Dominant language
- No language data
- Stars
- 16.5k
- Forks
- 3.3k
- PR merge metrics
- No merged PRs in 30d
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
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.
More from rubocop/ruby-style-guide
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rubocop/ruby-style-guide#884 · 3 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
rubocop/ruby-style-guide#968 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
rubocop/ruby-style-guide#961 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
rubocop/ruby-style-guide#957 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
rubocop/ruby-style-guide#953 ·
All issues in rubocop/ruby-style-guide
Similar issues
-
sync-en
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
external
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
langchain-ai/docs#6255 ·
Maintainers usually reply within 1 day
-
detectors enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
SM260845/readme-gen#1 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
angular/angularfire#3774 ·
Maintainers usually reply within 2 days
-
good first issue help wanted opensource september
Difficulty 1/5 Under an hour Newbie friendliness 88/100