[GOODIE] Three Value Fuzzy Logic

Brent Pinkney Brent at astarte.co.nz
Thu May 4 03:13:39 UTC 2000


Hi,

Here is a wee goodie which adds a setting to Compiler to NOT inline
#ifTrue:, #ifFalse: etc and also adds a new subclass Fuzzy of Boolean to try
this out.

The idea came from reading some long-winded pontification on comp.object
where it was argued that one of Smalltalks's benefits is that control
statements are just messages sent to an object and that there consequently
great benefits lurking in this flexiblity which is denied to those who have
sold their souls to Algol ands its nasty spawn. 

So I decided to try it out.

Now we all know this is not quite true as the compiler inlines these
messages where possible for performance. 

I found also a discussion between Andreas Raab and Russel Allen about what
would be required. (Search Google for: Three Value Logic Squeak). Thanks
also to Vassili Bykov for his great artricle on hitch-hicking through the
compiler.

To use, just file in the changest and follow the instructions in the class
comment of Fuzzy. I have tested it againt 2.7 and 2.8a

PS. To use this explicit ifTrue: stuff, only the code which may have a Fuzzy
as a receiver of ifTrue: and: etc needs to be compiled with Compiler
inlineBooleans == false. The rest of the image can continue with inlined
messages.

Thoughts.
1. Is this stuff remotely useful - apart from being cute.
2. The compiler changes should be extended to allow the #ifNil: stuff to be
selectively inlined as well for completion's sake.
3. Should one chose recompile all from 'Aardvark', what should be used to
benchmark the resulting image for correctness and performance ?

Finalyy, to Lex and co in the freshmeat thread....: 
Say I wished to enhave this change set over, how would it fit into the
freshmeat idea?

1. I wanted to ensure the changset works against any subsequebt Squeak
Central reference image (cos it changes Compiler !).
2. I had some SUnit tests I wanted to have executed.
3. I wanted upload newer versions ?

Cheers
Brent

 <<FuzzyLogic.8.cs>> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: FuzzyLogic.8.cs
Type: application/octet-stream
Size: 11352 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20000504/b81d3f16/FuzzyLogic.8.obj


More information about the Squeak-dev mailing list