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

Classlib: Fix IDict collect, select, reject to keep parent, proto and know #2507

Merged
merged 3 commits into from
Dec 17, 2016

Conversation

jamshark70
Copy link
Contributor

Also, clarify documentation and fix a broken link.

Fixes #2499.

… know

Also, clarify documentation and fix a broken link.
Copy link
Member

@telephon telephon left a comment

Choose a reason for hiding this comment

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

There are just a few suggestions, not obligatory.

@jamshark70


list::
## code::proto:: and code::parent:: values are not shown when posting the dictionary.
## Copying an IdentityDictionary transfers a reference to the parent and proto into the copy. It is a reference, not a copy: changing the copy's parent also affects the parent of the original. This is for efficiency.
Copy link
Member

Choose a reason for hiding this comment

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

(suggestion:)

this is more efficient than a deep copy, and also allows to inherit the dynamic relation to the parent.

list::
## code::proto:: and code::parent:: values are not shown when posting the dictionary.
## Copying an IdentityDictionary transfers a reference to the parent and proto into the copy. It is a reference, not a copy: changing the copy's parent also affects the parent of the original. This is for efficiency.
## Looping operations (link::Classes/Dictionary#-do::, link::Classes/Dictionary#-keysValuesDo::) only touch the main-level values.
Copy link
Member

Choose a reason for hiding this comment

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

technically this is iteration, no?

e[\a] + e[\b]
-> 15

// Looping touches 'a' only
Copy link
Member

Choose a reason for hiding this comment

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

again, I wouldn't have understood this as looping, but that may only be me.

reject { arg function;
var res = this.class.new(this.size, proto, parent, know);
this.keysValuesDo { arg key, elem; if(function.value(elem, key).not)
{ res.put(key, elem) } }
Copy link
Member

Choose a reason for hiding this comment

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

formatting?

@nhthn nhthn added comp: class library SC class library comp: help schelp documentation labels Nov 20, 2016
@nhthn nhthn added this to the 3.9 milestone Nov 20, 2016
@nhthn
Copy link
Contributor

nhthn commented Dec 16, 2016

I've pushed to the branch to address @telephon's issues, so this is ready to merge.

@telephon telephon merged commit f368b1d into supercollider:master Dec 17, 2016
@telephon
Copy link
Member

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: class library SC class library comp: help schelp documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants