Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
FlipRotate
Last updated at 3:04 am UTC on 24 July 2005
Work in progress please be patient (wiz).


Reverse provides a way to reorder a list.

The idea behind FlipRotate is to provide a way to generate any reordering of a list that can be produced by a combination of rotations and reversals.

So for a list of size n there are 2n reorderings.

The basic implementation of this is in SequentialCollection>flipRotated: aReorderingIndex.

Implementation notes:


Why FlipRotate is needed.


There are several places in Squeak where you have a list in one order and you want it in another.


Historic lore:

The programming goal that lead to the discovery of a need for fliprotate was a desire to create kaleidoscopes.
FlipRotate greatly simplified getting all the rotations and reflections of a rectangle and clarified the code in many places.

Coming soon - where to get the changeset.