I've gotten some positive results by querying #packageInfo for a class, such as String:
(String packageInfo referenceForMethod: #alike: ofClass: String) category. --> #comparing
The above will give you the method category for #alike: inside of the String class.
packageInfo returns a reference to a PackageInfo instance. The reason it references the class twice in the above example is you can also query for an array of methods (using a different method) for the entire protocol (up the inheritance hierarchy). So, you probably want to filter down to just the methods for your specific class.
PackageInfo also has #actualMethodsDo: which allows you to give it a block to use, so you can do something with all or some (you test for which you want to deal with, in the block. How you do that I leave to you to investigate. :) ) of the methods inside.
What you're going for is MethodReference's, which will allow you to query for their categories, using the method #category.
Hope this helps.
---Mark mmille10@comcast.net
On January 16, 2020 at 5:00 AM beginners-request@lists.squeakfoundation.org wrote:
Send Beginners mailing list submissions to beginners@lists.squeakfoundation.org
To subscribe or unsubscribe via the World Wide Web, visit http://lists.squeakfoundation.org/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-request@lists.squeakfoundation.org
You can reach the person managing the list at beginners-owner@lists.squeakfoundation.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..."
Today's Topics:
- code to retrieve all method categories and methods under a category (tty)
- Re: Squeak Oversight Board Election 2020 (Ron Teitelbaum)
- Re: code to retrieve all method categories and methods under a category (Tim Johnson)
Message: 1 Date: Wed, 15 Jan 2020 13:26:53 -0600 (CST) From: tty gettimothy@zoho.com To: beginners@lists.squeakfoundation.org Subject: [Newbies] code to retrieve all method categories and methods under a category Message-ID: 1579116413715-0.post@n4.nabble.com Content-Type: text/plain; charset=us-ascii
Hi All.
I want to dynamically build a drop-down menu in Seaside based on the instance side methods I have in a class.
#MyClass has method categories: "Attributes Links Paragraph....etc" Under Method category Links are methods #testLinkCategory, testLinkExternal, testLink....etc.
I have been hunting for over an hour and I see no obvious way to retrieve this info (I have found a way to get all the methods, but not the category that houses them.
The code I have in mind has form:
*categories := categoriesFor: #MyClass.
categories do:[:cat | |methods| methods := methodForClass:#MyClass category: cat. methods do:[:m | "dynamically build my html here" ]]l*
Any help much appreciated.
thx
-- Sent from: http://forum.world.st/Squeak-Beginners-f107673.html
Message: 2 Date: Wed, 15 Jan 2020 14:59:00 -0500 From: Ron Teitelbaum ron@usmedrec.com To: The general-purpose Squeak developers list squeak-dev@lists.squeakfoundation.org Cc: squeakland@lists.squeakland.org, Squeak Virtual Machine Development Discussion vm-dev@lists.squeakfoundation.org, "A friendly place to get answers to even the most basic questions about Squeak." beginners@lists.squeakfoundation.org Subject: Re: [Newbies] Squeak Oversight Board Election 2020 Message-ID: CAEzdQ-esxaddYvnksoqCnk1ksn8swY_EGF-oQrQNGMT5dyabmA@mail.gmail.com Content-Type: text/plain; charset="utf-8"
HI All,
Thank you again for everyone's participation in this years Squeak Oversight Board election. Edgar thank you for helping encourage people to participate! Feel free to keep that up!
We currently have 5 candidates for 7 board seats. In the order they announced:
Marcel Taeumel David T. Lewis Tim Rowledge Bert Freudenberg Craig Latta
Time is running out to announce your candidacy! Please announce soon! There are only 5 days left. You can follow along by visiting this webpage: http://wiki.squeak.org/squeak/6636
I will not be available Saturday through Monday morning. If you wait to announce this weekend and I don't update the webpage don't panic. I'll make sure to include you before the ballots go out on Monday. It would be better to announce between now and Friday!
Also if your email has changed or you want to get on the voters list please let me know! If you know someone that you would like to see on the board please reach out to them and ask them to run!
Thank you!
All the best,
Ron Teitelbaum
On Wed, Jan 15, 2020 at 9:21 AM Craig Latta craig@blackpagedigital.com wrote:
Hi all--
I'd like to serve on the Squeak Oversight Board in 2020 (wow, it
really does feel like Back to the Future now ;). I'm interested in looking back, as we sometimes do, to plan for the 25th anniversary of Squeak in 2021.
I've also been on a wild ride forward and to the side, with Bert's
SqueakJS VM and the Caffeine project. They've brought me into contact with many interesting Smalltalk, JavaScript, and livecoding-adjacent technologies and communities. I want to continue hatching strange ideas about them with my fellow board members, and with you.
Once hatched, those ideas want to grow in our collaborative spaces.
I've been helping with the board meeting notes for some time, but we haven't publicized them. I'd like to know how you'd like to see them appear on the Squeak project blog, our mailing lists, and in our live systems. Whatever we come up with will need to be done communally (each of us is doing many other things), but I'd like to help us restart here.
Another technical front I've been pushing recently is modularity
and team development. I'd like to get some more livecoders connected this year.
thanks again! Craig
[|] https://thiscontext.com [|] https://caffeine.js.org [|] https://toplap.org
-- Craig Latta Black Page Digital Amsterdam :: San Francisco @ccrraaiigg
Hi Mark,
Thank you.
Inspecting: (WikitextParserFactory packageInfo referenceForMethod: #testTableCaption ofClass: WikitextParserFactory)
the method symbol is populated but the 'category' is nil.
*squeak/shared/Squeak5.2-18229-64bit.image Squeak5.2 latest update: #18233 Current Change Set: WikitextParser Image format 68021 (64 bit)*
cheers.
-- Sent from: http://forum.world.st/Squeak-Beginners-f107673.html
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@comcast.net
-- Sent from: http://forum.world.st/Squeak-Beginners-f107673.html
beginners@lists.squeakfoundation.org