Happy !

emaringolo / SortFunctions

Project infos

License MIT
Tags sorting, magritte, utility
Creation date 2014-09-17
Website

Monticello registration

About SortFunctions

SortFunctions

SortFunctions is a set of utility classes and methods extensions that enable you to build composite sorting criteria without having to deal with complex block nesting and logic.

It enables you to write stuff like:

people sorted: #lastName ascending, #firstName descending.

SortFunctions is an version of the original TAG-SortFunctions written by Travis Griggs for VisualWorks and then ported to Pharo/Squeak by Nicolas Cellier.


Maggrite Support

This version of SortFunctions enables you to use Magritte Descriptions as building blocks of your sorting criteria.

E.g.

customers sorted: nameDescription ascending, representativeDescription descending undefinedLast

The above code snippet will sort the customers collection first by nameDescription and then by *representativeDescription * leaving those without an assigned sales representative at the end.

Installation

Gofer new
   url: 'http://smalltalkhub.com/mc/emaringolo/SortFunctions/main';
   package: 'ConfigurationOfSortFunctions';
   load.

To install the bare minimum (Core) features of SortFunctions execute:

((Smalltalk at: #ConfigurationOfSortFunctions) project stableVersion) load.

Or if you want to load Magritte support too then execute:

((Smalltalk at: #ConfigurationOfSortFunctions) project stableVersion) load: 'Magritte'.

... or the same but including Magritte tests:

((Smalltalk at: #ConfigurationOfSortFunctions) project stableVersion) load: 'Magritte-Tests'.