You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hasParent: anElement
"Return true if I have a given element in my parent chain, false otherwise"
self allParentsDo: [ :aParentElement |
aParentElement == anElement
ifTrue: [ ^ true ] ].
^ false
I propose to choose a more descriptive name + add a deprecation with a transformation rule.
The text was updated successfully, but these errors were encountered:
In contrast, hasParent (without arguments) is fine, as it answers whether the element has a parent:
hasParent
"Return true if I have a parent, otherwise false.
Being added as direct child to other element does not necessary
mean that I am in the space scene graph"
<return: #Boolean>
^ self parent isNotNil
but my problem is with hasParent: that receives another element as argument and determines if it has a parent and its the received element. IMO a Pharo developer would look for this method with something like "isChildOf:"
tinchodias
changed the title
BlElement: #hasParent: should be renamed to #isChildOf:
BlElement: Find a better name for hasParent:
Feb 12, 2025
hasParent:
is awkward IMHO. This is the method:I propose to choose a more descriptive name + add a deprecation with a transformation rule.
The text was updated successfully, but these errors were encountered: