Skip to content
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
runrevmark merged 6 commits into
livecode:developfrom
runrevmark:bugfix-11323_new
Jun 1, 2017
Merged

[[ Bugfix 11323 ]] Add new set ops and into form#5453
runrevmark merged 6 commits into
livecode:developfrom
runrevmark:bugfix-11323_new

Conversation

@runrevmark

Copy link
Copy Markdown
Contributor

This patch adds difference and symmetric difference set operation commands, and adds an 'into' clause to all four.

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.
@mention-bot

Copy link
Copy Markdown

@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.

runrevmark and others added 2 commits May 12, 2017 13:39
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.
if tKey is not among the keys of pLeft then
put pRight[tKey] into pLeft[tKey]
else
delete pLeft[tKey]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a huge deal but delete variable pLeft[tKey]

function ArrayDifference(pLeft, pRight)
repeat for each key tKey in pLeft
if tKey is among the keys of pRight then
delete pLeft[tKey]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing variable here too

@runrevmark

Copy link
Copy Markdown
Contributor Author

@livecodeali - I've tweaked the things you've found - so should be good for review!

@livecodeali

Copy link
Copy Markdown
Member

@livecode-vulcan review ok 66bb4ac

@livecode-vulcan

Copy link
Copy Markdown
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.
@livecode-vulcan

Copy link
Copy Markdown
Contributor

😎 test success 66bb4ac

  • try-community-armv6-android-api8: success
  • try-community-armv6-android-api9: success
  • try-community-js-emscripten-sdk1.35: success
  • try-community-universal-ios-iphoneos10.3: success
  • try-community-universal-ios-iphonesimulator10.3: success
  • try-community-universal-mac-macosx10.6: success
  • try-community-universal-mac-macosx10.9: success
  • try-community-x86-linux-debian7: success
  • try-community-x86-linux-debian8: success
  • try-community-x86_64-linux-debian7: success
  • try-community-x86_64-linux-debian8: success
  • try-community-x86-win32: success
  • try-community-x86_64-win32: success

@runrevmark runrevmark merged commit f9efa9b into livecode:develop Jun 1, 2017
@runrevmark runrevmark deleted the bugfix-11323_new branch June 1, 2017 15:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants