Release 1.6 This directory contains some example GNU Smalltalk programs. Those marked with STA were found on the WWW Smalltalk Archive (http://st-www.cs.uiuc.edu). The programs are: Application.st Attempt at adding support for an ENVY-like organization of by pb components into applications and subapplications. Must be integrated with the packaging system. bench.st An extraordinarily precise low-level benchmark for Smalltalk, by His Majesty contributed by Dwight Hughes and originarily prepared for Dan Ingalls! Squeak. It executes two pieces of code and deduces the system's speed in terms of bytecodes/second on bytecode-heavy code (arithmetics - sieve in this case) and sends/second on send-heavy code (a recursive Fibonacci computation in this case) -- they usually coincide to two digits with the speeds given by the GST runtime! Buffers.st Two useful classes used by TCP, the syntax highlighter, and by pb maybe somewhere else in the future. Case.st A nice object for C-switch like behavior. Although it is slower by Ulf than compiler-optimized ifs, try it: it really works nice. Dambacher CStream.st A stream providing functionality for writing C code. by sbb DBFile.st This class is a quite complete interface to dBase (DBF) files. by Antonio d'Avino (STA) Debugger.st Not yet tested attempt at creating a bytecode simulator which by pb/sbb would be used in debugging Smalltalk methods. Dinner.st The classic dining philosophers problem. You need working by pb Delays to try this (alarm is not very good but maybe it works). Try `(Philosophers new: 5) dine'. EditStream.st A stream handling fast insertions, using a double buffer by Ulf with a gap between the buffers. Dambacher GenClasses.st Provides help in creating many similarly named classes. by sbb IndStream.st A WriteStream which automatically indents code. by pb/sbb Lisp.st A nice Lisp interpreter class; try LispInterpreter exampleXX by Aoki Atsushi with XX going from 01 to 18. I modified it to remove the Nishihara Satoshi Smalltalk-subset compiler that was needed on commercial systems that don't allow a compiler to be enclosed in a run-time image -- it was 25% of the total code; this way there is more focus on the Lisp stuff. MemUsage.st This is really more of a test suite kind of program. It by sbb iterates through all the objects in the system, counting up how much storage has been used by each, and printing a total at the end. It has found more bugs in the memory management system than I (sbb) care to admit. Prolog.st This is absolutely stunning! A Prolog interpreter written in by Aoki Atsushi Smalltalk, from the same author as the Lisp interpreter; try Nishihara Satoshi PrologInterpreter exampleXX with XX going from 01 to 06 PrtHier.st prints out the class hierarchy, indented according to by sbb the number of super classes a class has. An example output is in the `hier' file: a 360 classes GNU Smalltalk system, I think the biggest ever loaded... Publish.st An object-oriented, multiple format class file-out system. by pb/sbb Currently includes Postscript for file-outs, and HTML/Texinfo for documentation -- by the way, this example is used by the makefile for GNU Smalltalk's info files. And also an example of namespaces. PushBack.st A Stream with unlimited push-back capabilities. Together with by sbb Tokenizer.st, it is used in many places (C interface, compiler) Queens.st An elegant solution of the queens and amazons problem (amazons by pb can move like either the queen or the knight). There are: 2 solutions (1 discarding rotations/reflections) on a 4x4 board 92 solutions (12) on a 8x8 board no solutions (!) to the amazons problem on a 8x8 board 4 solutions (1) to the amazons problem on a 10x10 board A few examples usages are at the end of the file. RandomInt.st Provides methods that generate a random integer in a specific by Andy range. Valencia RecursLit.st Makes the browser search for literals in Arrays. For example by unknown code like `^#(isThisSent)' will be reported to send #isThisSent (STA) only if you file-in this file. Richards.st The Richards benchmark (a simulation of an operating systems) by unknown under Smalltalk, a classic in Smalltalk benchmarking because of its use of polymorphism and OO. shell An example of how to make a Smalltalk script work both if you by pb file it in from GNU Smalltalk and if you launch it from the shell; for it to work, the gst executable must be in the path. If it is not, just do PATH=$PATH: before running it. SortCriter.st A very nice object that allows you to easily create by Peter SortedCollections sorted using complex objects (specifying William Lount which fields are more important and which must be sorted in descending order). Timer.st A nice little class (Timer) to experiment with Delays. by Herman Van Durme (STA) Tokenizer.st An abstract base class for lexical analyzers. STTok, the by pb/sbb compiler's lexical analyzer, is derived from Tokenizer. Watchdog.st A watchdog timer to check for system hangups. by Ulf Dambacher The `mixed' directory contains some other small example GNU Smalltalk programs which test more advanced aspects of Smalltalk, either various packages or the VM. Among others, `ClsInstV.st' tests class instance variables, and `torture.st' is Andreas Klimas' nice memory torture test program - like MemUsage.st it has found more bugs in the memory management system than I (pb) care to admit... `resolve.st', by Steve Byrne, needs DLD and is a Smalltalk interface to the network resolver. The `blox' directory contains: Man.st Man page viewer widget (example of using BExtended). To test by pb it evaluate "ManViewer openOn: 'path' " Will somebody write a Smalltalk xman?!? (that means you...) Send it to me if you do! Tetris.st A Tetris game written using BLOX. A few notes: by pb 1) you should have a precise version of Delays to use it (Win32 or an OS with setitimer, like BSD and Linux). Simple `alarm' (which has only 1 second precision) is not enough. 2) Cursor keys move the piece, Up rotates it, Return drops it. To start it, use "Tetris play" More examples can be found in the blox/BloxExtend.st file