2014-01-03 21:58 GMT+01:00 <[hidden email]>: Colin Putney uploaded a new version of Environments to project The Trunk: <rant> Hmm, the change of Environment definition would have deserved an update of Environment comment... Some senders of bindingOf: are currently not working (see MCEnvironmentLoadTest), though they once did. This is because bindingOf: uses bindings inst var which is left empty by #testLoadIntoEnvironment. This inst var is not documented and it's not obvious to guess its purpose. It seems that declarations are filled, so I should probably use declarationOf: instead of bindingOf: But that's a blind guess, that means that I change code without understanding the details, and that ain't good. If I want to understand, I will have to open many browsers on senders chains, tests, etc... instead of reading a simple comment. And if I want to review the senders of bindingOf:ifAbsent: / bindingOf: then good luck... Very few will be writing Environment code. Many will read it. My feeling as a reader is that the writers have lack of empathy with the readers. Maybe I'm dumb, but I like to be dumb. Being smart costs too much energy, and in my experience, the smarter the code, the merrier the missinterpretations (that is the bugs). </rant> Item was removed: |
2014-05-26 23:19 GMT+02:00 Nicolas Cellier <[hidden email]>:
I'm also puzzled because currently #hasBindingOf: bases its results on declarations, while #bindingOf: bases its results on bindings, so they kind of disagree. When the name does not tell, it's probably better to change the name, or at least to comment a bit...
|
2014-05-26 23:26 GMT+02:00 Nicolas Cellier <[hidden email]>:
The answer would be: #testInternalVisibility The own declarations are not visible in an Environment, unless it importSelf... Then the bindings will include the declarations (plus some other bindings imported from some other environments). hasBindingOf: should check declarations because it means that this is the primary environment of the global Environment allInstancesDo: [:anEnvironment | anEnvironment allClassesAndTraitsDo: [:aClass | self assert: aClass environment == anEnvironment]].I still do not understand why associationAt: ask the declarations, while associationOrUndeclaredAt: asks the bindings, but there are flag: #review, so I'm not alone (many messages emulating old Dictionary or SmalltalkImage protocols should be reviewed too anyway).
|
Free forum by Nabble | Edit this page |