[BUG] equivalence between strings and symbols

R. A. Harmon harmonra at webname.com
Wed Apr 12 18:56:05 UTC 2000


At 04:03 PM 4/12/00 +0200, Torge Husfeldt wrote:
>----- Original Message -----
>From: R. A. Harmon <harmonra at webname.com>
>To: <squeak at cs.uiuc.edu>
>Sent: Tuesday, April 11, 2000 9:59 PM
>Subject: Re: [BUG] equivalence between strings and symbols
>
>
>> At 09:59 PM 4/10/00 -0700, Dan Ingalls wrote:
>> [snip]
>> >most can be located by searching for the pattern <Symbol literal> =
>> <expression>
>> > or <expression> = <Symbol literal>.
>> [snip]
>>
>> How do I do a pattern search like the above?
>Some are easy, some ain't.
>e.g. locating
><expression> [= == ~=] <Symbol literal>
>can be found using:
>| scanner |
>Smalltalk browseAllSelect:
> [:cm |
> scanner _ InstructionStream on: cm.
> scanner scanFor: [:instr |
>  ((instr between: 32 and: 63 "push literal Const")
>   and:[(cm literalAt: (instr bitAnd: 16r1F) + 1 )  isSymbol])
>    and: [#(182 "=" 183 "~=" 198 "==") includes: scanner followingByte]]]
[snip]

Worked like a champ.  Thanks for passing it on to me.

--
Richard A. Harmon          "The only good zombie is a dead zombie"
harmonra at webname.com           E. G. McCarthy
Spencer, Iowa





More information about the Squeak-dev mailing list