References to symbols or atoms

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

References to symbols or atoms

Postby Thomas Holzer » Wed Mar 04, 2009 6:06 am

Hi,

I´m looking for a way to find references to symbols or atoms in the Smalltalk source. I found a discussion on comp.lang.smalltalk:
http://groups.google.com/group/comp.lan ... 9b3d25a950
But I did not manage to find a way in VA Smalltalk to find references for symbols. Although, I found strange atoms in few system methods. This looks exactly like the solution I was looking for. For example:

Code: Select all
CwToggleButton>>createEwFlowedIconList: theName argBlock: argBlock
  ##PR = ##'1E3MPXK'.
   ^EwFlowedIconList
      createWidget: theName
      parent: self
      argBlock: argBlock


PR stands for problem report? And the '1E3MPXK' is the problem number? How to find the methods with PR 1E3MPXK?

Could someone explain how this works, and how could I find references to symbols or atoms?

Regards Thomas
Thomas Holzer
 
Posts: 16
Joined: Fri Nov 21, 2008 2:14 am

Re: References to symbols or atoms

Postby tc » Wed Mar 04, 2009 10:28 am

Hello,

##'1E3MPXK', when inspected, comes back as an EsAtom and I do not think one can search for that through the 'browse references' function.

However, under the options menu in the transcript, there is a method string search function. That would find the string '1E3MPXK'.

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC

Re: References to symbols or atoms

Postby marten » Wed Mar 04, 2009 10:38 am

You may use "Browse References ..." frm Transcript>Options menu and enter "PR" (without ##) or "1FI579S" (without ##) and you will find the place (and some others too).

Marten
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: References to symbols or atoms

Postby tc » Wed Mar 04, 2009 10:46 am

The menu item Options -> browse methods -> including string or a different one?

-tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC

Re: References to symbols or atoms

Postby marten » Wed Mar 04, 2009 12:22 pm

I was wrong, it's from Transcript>>Tools menu "Browse References ..." and I think, it's the same tool you mentioned two postings earlier in this thread - you can get the information needed via this menu entry - though one seem to get also some additional hits ...
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: References to symbols or atoms

Postby tc » Wed Mar 04, 2009 9:33 pm

Hello,

What exactly do you type because I get zero hits.

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC

Re: References to symbols or atoms

Postby marten » Wed Mar 04, 2009 10:54 pm

tc wrote:Hello,

What exactly do you type because I get zero hits.

--tc


Well I type

PR

and get several hits for the atomic ##PR but also for string 'PR'.

As an example CfsFileDescriptor class>>copy:to: includes

##PR = ##'1EUSVRC'
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: References to symbols or atoms

Postby benvandijk » Thu Mar 05, 2009 12:29 am

Hi Thomas,

You can also find symbois using the browse senders from the transcript menu (or any other menu).
You have to type the symbol without the # to get a result.

Greetings, Ben.

P.S. Marten: I think you was confusing the options menu from the VA Organizer with the tools menu in the Transcript :)
benvandijk
 
Posts: 45
Joined: Sun Feb 25, 2007 7:14 am
Location: Arnhem, Netherlands

Re: References to symbols or atoms

Postby tc » Thu Mar 05, 2009 10:56 am

Hello,

Got it. Just tried it again and:

#PR = ##'1G4CZE9'.

. . . #PR can be found by doing references or senders of PR. ##'1G4CZE9' can be found by doing references to 1G4CZE9 (no quotes).

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC

Re: References to symbols or atoms

Postby rjs » Sun Mar 08, 2009 9:45 am

There is a related issue for what I believe are called compile time constants (CTC). These are similar to Atoms, but entail more code than a simple symbol or string. For example:
Code: Select all
    ^##(Dictionary new
        at: self someKeyMethod put: self someValue;
        yourself)


You cannot use the Tools/References or Tools/Senders to determine this method uses Dictionary, #someKeyMethod, or #someValue.

It would be nice if methods using compile time constants would (optionally could) record the global references, method selectors, and other literals used to build the CTC.
rjs
 
Posts: 39
Joined: Thu Mar 27, 2008 11:07 am
Location: Port Perry, Ontario, Canada


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest