[squeak-dev] The Inbox: Environments-jr.70.mcz
Bert Freudenberg
bert at freudenbergs.de
Mon Feb 13 11:01:26 UTC 2017
On Sun, Feb 12, 2017 at 4:56 PM, <commits at source.squeak.org> wrote:
> A new version of Environments was added to project The Inbox:
> http://source.squeak.org/inbox/Environments-jr.70.mcz
>
> ==================== Summary ====================
>
> Name: Environments-jr.70
> Author: jr
> Time: 12 February 2017, 3:42:16.327498 pm
> UUID: cbbca4a2-6a97-2b40-92b8-631bbfa519d0
> Ancestors: Environments-jr.69
>
> add hasClassOrTraitNamed:
>
> useful for lists of behaviors
>
> =============== Diff against Environments-jr.69 ===============
>
> Item was added:
> + ----- Method: Environment>>hasClassOrTraitNamed: (in category 'classes
> and traits') -----
> + hasClassOrTraitNamed: aString
> + Symbol hasInterned: aString ifTrue:
> + [:symbol | | value |
> + ^ ((value := declarations at: symbol ifAbsent: [nil])
> + isKindOf: Class) or: [value isKindOf: Trait]].
> + ^ false.!
>
Please do not introduce #isKindOf tests. All the other classOrTrait*
methods use #isBehavior tests, which is way more general ... and also in
line with your commit message ;)
I'd rather implement this along the lines of "^(self classOrTraitNamed:
aString) notNil" which would also make the argument compatible with the
range of strings allowed by classOrTraitNamed:.
We may want to add a Symbol internment check to that method, however.
- Bert -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20170213/4f4e9ae0/attachment-0001.html>
More information about the Squeak-dev
mailing list
|