Hello All,
I know the class name and the method selector. Is there any UI in the current Store Tools which would allow me to query the Store db to find out the Package this method was first defined in? Or to allow me to browse the Store implementation of unloaded method if I know the Class and selector ? Any pointers would be greatly appreciated. TIA, --Mark |
Mark Pirogovsky wrote:
> Hello All, > > I know the class name and the method selector. Is there any UI in the > current Store Tools which would allow me to query the Store db to find > out the Package this method was first defined in? > Or to allow me to browse the Store implementation of unloaded method if > I know the Class and selector ? I don't know an UI that does what you want, but you can call some code in a workspace: ((( Store.Method allMethodVersionsNamed: 'nameOfSelector' inClass: 'Root.Smalltalk.NameOfClass' meta: false ) asSortedCollection: [: m1 : m2 | m1 timeStamp <= m2 timeStamp ]) first containingPackages asSortedCollection: [: m1 : m2 | m1 timeStamp <= m2 timeStamp ]) last displayString. For class methods #meta must be set to true. And yeah, it looks ugly ;) Regards, Holger |
Holger Kleinsorgen wrote:
> ((( Store.Method allMethodVersionsNamed: 'nameOfSelector' inClass: > 'Root.Smalltalk.NameOfClass' meta: false ) > asSortedCollection: [: m1 : m2 | m1 timeStamp <= m2 timeStamp ]) > first containingPackages > asSortedCollection: [: m1 : m2 | m1 timeStamp <= m2 timeStamp ]) > last displayString. Bugfix: last line should be "first displayString", not "last displayString." |
Thanks Holger,
it was very helpful. Here is the Workspace script to show all of the versions of the methods for he class available in store: |inst | ( inst := TabApplicationSystemBrowser new ) tabApplication: ( TabApplicationSystemBrowser defaultVersionBrowserTab newOnBrowser: inst ); browseMethodsOrStatics: ((( Store.Method allMethodVersionsNamed: 'nameOfSelector' inClass: 'Root.Smalltalk.NameOfClass' meta: true /false ) asSortedCollection: [: m1 : m2 | m1 timeStamp <= m2 timeStamp ])); open. inst builder window label: 'nameOfSelector', ' Version Browser' --Mark Holger Kleinsorgen wrote: > Holger Kleinsorgen wrote: > >> ((( Store.Method allMethodVersionsNamed: 'nameOfSelector' inClass: >> 'Root.Smalltalk.NameOfClass' meta: false ) >> asSortedCollection: [: m1 : m2 | m1 timeStamp <= m2 timeStamp ]) >> first containingPackages >> asSortedCollection: [: m1 : m2 | m1 timeStamp <= m2 timeStamp ]) >> last displayString. > > > > Bugfix: last line should be "first displayString", not "last > displayString." > > > |
In reply to this post by Mark Pirogovsky-3
At 10:03 AM 3/14/2006, Mark Pirogovsky wrote:
>Hello All, > >I know the class name and the method selector. Is there any UI in the current Store Tools which would allow me to query the Store db to find out the Package this method was first defined in? > Or to allow me to browse the Store implementation of unloaded method if I know the Class and selector ? > >Any pointers would be greatly appreciated. If you have the method in your image, then you can easily bring up a version list on it. And if you select a particular version of that method you can ask for containing package versions, the first of which is presumably the first one it was defined in. If you don't have it loaded, from the Class pane, Store->Browse Removed Methods will give you a list of methods in that class but not in the image, and allow you to get a version browser on it. From there, you can ask for containing versions. Or if you have StoreForGlorpVWUI loaded, while it's not a UI, you could open a StoreWorkspace, and run the following expression packages := session read: StorePackage where: [:each | each methods anySatisfy: [:eachMethod | eachMethod definition name = 'yourself']]. (packages asSortedCollection: [:a :b | a timestamp <= b timestamp]) first. But that's not a fast query on a large database, as it's full-scanning all methods. Also, this is one of the predefined ones in the workspace, but I notice it's wrong there - hasn't kept up to date with some changes in the model. -- Alan Knight [|], Cincom Smalltalk Development [hidden email] [hidden email] http://www.cincom.com/smalltalk "The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross |
In reply to this post by Holger Kleinsorgen-4
From the Transcript, Store>>Browse Definitions>>Selector. This accepts
wildcards. Select the class and it will show you all the definitions of that method regardless of package. In the RB, class menu, Store>>Browse Removed Methods will show you methods for a class that are in the database, but not your image. > Mark Pirogovsky wrote: >> Hello All, >> >> I know the class name and the method selector. Is there any UI in the >> current Store Tools which would allow me to query the Store db to find >> out the Package this method was first defined in? >> Or to allow me to browse the Store implementation of unloaded method if >> I know the Class and selector ? > > I don't know an UI that does what you want, but you can call some code in > a workspace: > > ((( Store.Method allMethodVersionsNamed: 'nameOfSelector' inClass: > 'Root.Smalltalk.NameOfClass' meta: false ) > asSortedCollection: [: m1 : m2 | m1 timeStamp <= m2 timeStamp ]) > first containingPackages > asSortedCollection: [: m1 : m2 | m1 timeStamp <= m2 timeStamp ]) > last displayString. > > For class methods #meta must be set to true. And yeah, it looks ugly ;) > > Regards, Holger > > |
Hello all, Does anyone know of the ETA of an Intel VM for the Mac? stp -- Stephen Travis Pope -- Santa Barbara, California, USA |
Stephen,
>Does anyone know of the ETA of an Intel VM for the Mac? It is being worked on as we speak. By 7.5 for sure, maybe (MAYBE!) sooner. And So It Goes Sames ______________________________________________________________________ Samuel S. Shuster [|] VisualWorks Engineering, GUI Project Smalltalk Enables Success -- What Are YOU Using? |
stp
-- Stephen Travis Pope -- Santa Barbara, California, USA Begin forwarded message:
|
Free forum by Nabble | Edit this page |