This repository was archived by the owner on Aug 31, 2021. It is now read-only.
[[ Bugfix 11323 ]] Add new set ops and into form#5453
Merged
Conversation
This patch implements 'difference' and 'symmetric difference' commands for arrays. The difference command removes all keys from the destination which are present in the source, and leaves all others alone. The symmetric difference command removes all keys from the destination which are present in the source, and adds all keys from the source which are not present in the destination.
This patch adds an 'into' clause to the set operation commands allowing commands such as: intersect tLeft with tRight into tResult The operation of the commands is the same as the non-into form except that tLeft does not have to be a variable, and the result of the operation is placed into tResult rather than mutating tLeft.
|
@runrevmark, thanks for your PR! By analyzing the history of the files in this pull request, we identified @livecodeali and @livecodefraser to be potential reviewers. |
The use of MCAutoPointer<MCVarref> requires that MCVarref be completely defined in the cmds.h header. This patch corrects this by including variable.h in cmds.h.
11ace3b to
6c862f4
Compare
livecodeali
reviewed
May 23, 2017
| if tKey is not among the keys of pLeft then | ||
| put pRight[tKey] into pLeft[tKey] | ||
| else | ||
| delete pLeft[tKey] |
Member
There was a problem hiding this comment.
not a huge deal but delete variable pLeft[tKey]
livecodeali
reviewed
May 23, 2017
| function ArrayDifference(pLeft, pRight) | ||
| repeat for each key tKey in pLeft | ||
| if tKey is among the keys of pRight then | ||
| delete pLeft[tKey] |
Contributor
Author
|
@livecodeali - I've tweaked the things you've found - so should be good for review! |
Member
|
@livecode-vulcan review ok 66bb4ac |
Contributor
|
💙 review by @livecodeali ok 66bb4ac |
livecode-vulcan
added a commit
that referenced
this pull request
May 30, 2017
[[ Bugfix 11323 ]] Add new set ops and into form This patch adds difference and symmetric difference set operation commands, and adds an 'into' clause to all four.
Contributor
|
😎 test success 66bb4ac
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch adds difference and symmetric difference set operation commands, and adds an 'into' clause to all four.