Custom method browser "trick"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Custom method browser "trick"

Schwab,Wilhelm K
Hello all,

I'm working on my re-underscoring of GSL.  It's been a lot of work, but I really believe it will pay off in the future in terms of being able more easily find methods of interest because with underscores, they look like the things one might find in the manual.   It was *really* important with PLplot which has names that are surprisingly cryptic to start.

Back to GSL, I wanted a list of methods that contain the "old" structure prefix (SGsl - not sure why I chose that...), are not in a category of old items, and are not simply in the old stucts (#fields, accessors).  The following seems to do the job:

        | nav suspects |
   
    nav := SystemNavigation new.
    suspects := nav
                            allMethodsWithSourceString:'SGsl'
                            matchCase:true.
    suspects := suspects reject:[ :each |
        each category = 'public-old'
            or:[ each classSymbol beginsWith:'SGsl' ] ].

    nav
        browseMessageList:suspects
        name: 'Methods referencing old GSL structs'
        autoSelect:'SGsl'.

It might be a useful trick for some of you??  HTH.

Bill



Reply | Threaded
Open this post in threaded view
|

Re: Custom method browser "trick"

Schwab,Wilhelm K
One more:

        | nav oldSelectors senders |
       
    nav := SystemNavigation new.
    oldSelectors := OrderedCollection new.
    ( GSLLibrary allMethodsInCategory:'public-old' ) do:[ :each |
        oldSelectors add:each.
    ].

    senders := OrderedCollection new.
    oldSelectors do:[ :each |
        senders addAll:( nav allSendersOf:each ).
    ] displayingProgress:'Old selectors'.
    senders := senders copyWithoutDuplicates.

    nav
        browseMessageList:senders
        name: 'Methods sending old GSL methods'
        autoSelect:'gsl'.

Because of the loop over 1400 or so methods, it takes several minutes to run.  It found 18 violators that I was easily able to fix in the resulting method list.  Hopefully the GSL wrapper is now purged of the old methods and structs.

Bill



From: [hidden email] [[hidden email]] on behalf of Schwab,Wilhelm K [[hidden email]]
Sent: Thursday, March 22, 2012 1:53 PM
To: [hidden email]
Subject: [Pharo-project] Custom method browser "trick"

Hello all,

I'm working on my re-underscoring of GSL.  It's been a lot of work, but I really believe it will pay off in the future in terms of being able more easily find methods of interest because with underscores, they look like the things one might find in the manual.   It was *really* important with PLplot which has names that are surprisingly cryptic to start.

Back to GSL, I wanted a list of methods that contain the "old" structure prefix (SGsl - not sure why I chose that...), are not in a category of old items, and are not simply in the old stucts (#fields, accessors).  The following seems to do the job:

        | nav suspects |
   
    nav := SystemNavigation new.
    suspects := nav
                            allMethodsWithSourceString:'SGsl'
                            matchCase:true.
    suspects := suspects reject:[ :each |
        each category = 'public-old'
            or:[ each classSymbol beginsWith:'SGsl' ] ].

    nav
        browseMessageList:suspects
        name: 'Methods referencing old GSL structs'
        autoSelect:'SGsl'.

It might be a useful trick for some of you??  HTH.

Bill