smalltalk - Checking for the presence of a class -
i check if particular class has been loaded.
smalltalk at: #tabularxslxexport ifnone: [ ] this not lead result in pharo. how do this?
i think method you're looking #at:ifabsent: (not #at:ifnone:).
so, inspecting result of
smalltalk at: #string ifabsent: [ nil ] will let inspect string class, while
smalltalk at: #strign ifabsent: [ nil ] will open inspector on nil (note "strign" deliberate misspelling of "string" lookup fails).
edit: max leske points out in comments, #hasclassnamed: more suitable method if you're trying determine whether class exists, , not interested in class being returned.
Comments
Post a Comment