-
Notifications
You must be signed in to change notification settings - Fork 757
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
Classlib: Fix IDict collect, select, reject to keep parent, proto and know #2507
Conversation
… know Also, clarify documentation and fix a broken link.
There was a problem hiding this 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.
|
||
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting?
I've pushed to the branch to address @telephon's issues, so this is ready to merge. |
thanks! |
Also, clarify documentation and fix a broken link.
Fixes #2499.