bit shifting

Dan Ingalls DanI at wdi.disney.com
Wed Apr 15 23:11:31 UTC 1998


Folks --

I proposed to use positive numbers for bit patterns, and to forbid bit manipulation of negative numbers.

This was countered by the observation that there is a perfectly consistent definition for bit manipulation of arbitrary-precision two's complement negative numbers.

Here is my philosphy:  I like to take squeak in the direction of generality and uniformity whenever it is either useful or enlightening (or both).  An example of this, (which I was sad to hear ANSI will not support) is uniform support for both radix specifiers and exponent specifiers in Floats as well as Integers.  I have found these useful, and I have watched students spend hours having fun with number base and place value using this facility.

While I understand the consistent definition for bit manipulation of arbitrary-precision two's complement negative numbers, I have three questions:

	1.  Has someone here actually used this facility and found it to be
	     either useful or enlightening (or both)?

	2.  Do folks prefer the idea of revealing (and revelling in) an
	     underlying two's complement model, to leaving it abstract?

	3.  Would folks prefer to have bit manipulation of negative numbers
	     worked out "right" to having a simpler system that did not address it?
	     [I mainly mean simpler by omission, but it would also take less code
	     unless someone want to reimplement the whole largeInt package.

Please respond TO ME and not to the Squeak list, and I'll publish the results.

Thanks
	- Dan





More information about the Squeak-dev mailing list