Skip to content
This repository has been archived by the owner on Mar 3, 2018. It is now read-only.

Prefer R.inc and R.dec over R.add by 1 or -1 #3

Open
lo1tuma opened this issue Dec 16, 2015 · 3 comments
Open

Prefer R.inc and R.dec over R.add by 1 or -1 #3

lo1tuma opened this issue Dec 16, 2015 · 3 comments

Comments

@lo1tuma
Copy link
Owner

lo1tuma commented Dec 16, 2015

This should be a warning:

R.add(1) // could be written as R.inc
R.add(-1) // could be written as R.dec
@davidchambers
Copy link

R.subtract(1) is not equivalent to R.dec. Instead, we want:

  • R.add(1) better written R.inc; and
  • R.add(-1) better written R.dec.

@lo1tuma lo1tuma changed the title Prefer R.inc and R.dec over R.add and R.subtract by 1 Prefer R.inc and R.dec over R.add by 1 or -1 Dec 17, 2015
@lo1tuma
Copy link
Owner Author

lo1tuma commented Dec 17, 2015

@davidchambers Good catch, thanks. I‘ve updated the description.

@gilligan
Copy link
Collaborator

Oops, thanks @davidchambers - that happens when I make up stuff on a blackboard :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants