[Newbies] Beginners Digest, Vol 156, Issue 5

MARK MILLER mmille10 at comcast.net
Thu Jan 16 14:37:06 UTC 2020


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 at comcast.net

> On January 16, 2020 at 5:00 AM beginners-request at lists.squeakfoundation.org wrote:
> 
> 
> Send Beginners mailing list submissions to
> 	beginners at 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 at lists.squeakfoundation.org
> 
> You can reach the person managing the list at
> 	beginners-owner at lists.squeakfoundation.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Beginners digest..."
> 
> 
> Today's Topics:
> 
>    1. code to retrieve all method categories and methods under	a
>       category (tty)
>    2. Re: Squeak Oversight Board Election 2020 (Ron Teitelbaum)
>    3. 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 at zoho.com>
> To: beginners at lists.squeakfoundation.org
> Subject: [Newbies] code to retrieve all method categories and methods
> 	under	a category
> Message-ID: <1579116413715-0.post at 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 at usmedrec.com>
> To: The general-purpose Squeak developers list
> 	<squeak-dev at lists.squeakfoundation.org>
> Cc: squeakland at lists.squeakland.org, Squeak Virtual Machine
> 	Development Discussion <vm-dev at lists.squeakfoundation.org>, "A
> 	friendly place to get answers to even the most basic questions about
> 	Squeak." <beginners at lists.squeakfoundation.org>
> Subject: Re: [Newbies] Squeak Oversight Board Election 2020
> Message-ID:
> 	<CAEzdQ-esxaddYvnksoqCnk1ksn8swY_EGF-oQrQNGMT5dyabmA at 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 at 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
> >
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20200115/c5492d2c/attachment-0001.html>
> 
> ------------------------------
> 
> Message: 3
> Date: Wed, 15 Jan 2020 15:51:49 -0600
> From: Tim Johnson <digit at sonic.net>
> To: "A friendly place to get answers to even the most basic questions
> 	about Squeak." <beginners at lists.squeakfoundation.org>
> Subject: Re: [Newbies] code to retrieve all method categories and
> 	methods	under a category
> Message-ID: <42186A7D-6CF8-40E6-9D0F-3088506B9515 at sonic.net>
> Content-Type: text/plain; charset=us-ascii
> 
> Hi Timothy,
> 
> On Jan 15, 2020, at 1:26 PM, tty wrote:
> 
> > Hi All.
> > 
> > I want to dynamically build a drop-down menu in Seaside based on the
> > instance side methods I have in a class.
> 
> Have you looked at the Seaside sample code for the WABrowser?  On some Seaside images it will be registered at tools/classbrowser by default.  I believe it uses a normal Browser as its model, so that's where to go to find out what's actually going on in the background.
> 
> > 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.
> > 
> > Any help much appreciated.
> 
> Have you looked at ClassOrganizer and ClassDescription?
> 
> best,
> a Tim
> 
> 
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
> 
> 
> ------------------------------
> 
> End of Beginners Digest, Vol 156, Issue 5
> *****************************************


More information about the Beginners mailing list