Why can't I do (aNonSmallInteger becomeFoward: aSmallInteger)?

Bijan Parsia bparsia at email.unc.edu
Mon Apr 1 21:10:43 UTC 2002


On Mon, 1 Apr 2002, Brian Keefer wrote:
[snip]
> Thanks! I just might have found that myself, if <primitive:> weren't such
> a dead end. ([REQ] some comments in primitive calls to show where to trace
> from here). So, step 1, I refactor out the and: part of containsOnlyOops.
[snip]

<CSTOD>
	Browser fullOnClass: Interpreter 
		selector: (Interpreter primitiveTable at: 2).

	"Or whatever the primative number is - 1."
</CSTOD>

This will open a browser on the numbered primative's source code. (Well,
not for plugins...exercise for the reader.)

Modifying the pretty printer to make this a hyperlink for where it sees
<primitive: 3> is also left as an exercise for the reader :)


Hmm. Browsing with colorPrint already does a bit of this:

SmallInteger>>*

With source:
	...
	<primitive: 9>
	^ super * aNumber

With colorPrettyPrinting (ok, any pretty printing):


	<primitive: 9> "primitiveMultiply" 
	^ super * aNumber

So, perhaps messing with MethodNode>>printPrimitiveOn: will help.

(It's not *so* terrible, but it will require a changeset, not a CSTOD.)

Cheers,
Bijan Parsia.




More information about the Squeak-dev mailing list