[Newbies] Beginners Digest, Vol 156, Issue 5

Mark Miller mmille10 at comcast.net
Fri Jan 17 06:17:49 UTC 2020


tty wrote
> Hi Mark,
> 
> Thank you.
> 
> 
> Inspecting:
> (WikitextParserFactory packageInfo referenceForMethod: #testTableCaption
> ofClass: WikitextParserFactory)
> 
> the method symbol is populated but the 'category' is nil.

Sorry about that. Looking closer at the method list for PackageInfo, I think
it operates in conjunction with Monticello, and perhaps other package
managers. When I tried creating my own class, I got nil when using
#packageInfo.

It turns out the answer may be simpler.

MethodReference has class-side methods for giving you instances of itself,
based on a class, and the method specification you give it. So, you should
be able to do:

(MethodReference class: WikitextParserFactory method: #testTableCaption)
category

I tried this out with a class of my own, and it works. (It also works for
classes such as String.)

As I showed earlier, if a method is categorized, you will get the method's
category back as a symbol. If a method is not categorized, you will get #'as
yet unclassified' as a return value.

---Mark
mmille10 at comcast.net




--
Sent from: http://forum.world.st/Squeak-Beginners-f107673.html


More information about the Beginners mailing list