Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array Arithmetic #50

Closed
phase opened this issue Nov 21, 2015 · 9 comments
Closed

Array Arithmetic #50

phase opened this issue Nov 21, 2015 · 9 comments

Comments

@phase
Copy link
Owner

phase commented Nov 21, 2015

  • [234]3+ should add 3 to each element in the array.
  • [679]2- should subtract 2 from each element in the array.
  • [248]2* should multiply each element in the array by 2.
  • [369]3/ should divide each element in the array by 3.
@phase phase added the feature label Nov 21, 2015
@phase phase added this to the Reimplement the rest of O milestone Nov 21, 2015
@refi64 refi64 self-assigned this Nov 21, 2015
@refi64
Copy link
Collaborator

refi64 commented Nov 21, 2015

Ooooh, I'm claiming this! It sounds fun! :D

@phase
Copy link
Owner Author

phase commented Nov 22, 2015

This also applies for ^, %, and other math operators. I also think an operator for checking if an object is in an array would be nice, but I don't know what character we could overload.

@refi64
Copy link
Collaborator

refi64 commented Nov 22, 2015

@phase <?

@phase
Copy link
Owner Author

phase commented Nov 22, 2015

That could also be used for determining if one array is bigger than another.

  • [123] 3 <o prints 1 because 3 is in array [1, 2, 3].
  • [1234] [123] <o prints 0
  • [1234] [123] >o prints 1

@refi64
Copy link
Collaborator

refi64 commented Nov 22, 2015

@phase By bigger, you mean bigger lengthwise?

@phase
Copy link
Owner Author

phase commented Nov 22, 2015

Yes 👍

refi64 added a commit that referenced this issue Nov 22, 2015
@phase
Copy link
Owner Author

phase commented Nov 28, 2015

[456]& would leave the stack like [45] 6; it pops a value off of the array and pushes it to the stack.

phase added a commit that referenced this issue Nov 28, 2015
@refi64
Copy link
Collaborator

refi64 commented Feb 6, 2016

Almost done! All that's left is [123]1<.

refi64 added a commit that referenced this issue Mar 27, 2016
@refi64
Copy link
Collaborator

refi64 commented Mar 27, 2016

@phase This can finally be closed!

@refi64 refi64 closed this as completed Mar 27, 2016
@refi64 refi64 self-assigned this Mar 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants