Skip to content

Commit

Permalink
Added Object>>#isKindOf:
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Nov 29, 2020
1 parent 06ceed7 commit 32193cb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Smalltalk/Object.som
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,14 @@ Object = nil (
instVarAt: idx put: obj = primitive
instVarNamed: sym = primitive

isKindOf: class = (
| superclass |
self class == class ifTrue: [ ^ true ].


[(superclass := self class superclass) == nil] whileFalse: [
superclass == class ifTrue: [ ^ true ] ].

^ false
)
)

0 comments on commit 32193cb

Please sign in to comment.