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

Popular posts from this blog

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -