`*-----------------------------------*`

`*           >>>Pico 2.0<<<          *`

`*         Wolfgang De Meuter        *`

`*  VUB Programming Technology Lab   *`

`*               ©2004               *`

`*-----------------------------------*`

`*  Generic Selection Sort Routine   *`

`*-----------------------------------*`

{ selection(t,l << r):: {

    swap(i,j):{

      temp: t[i];

      t[i]:=t[j];

      t[j]:=temp };

    for(k:1, k<size(t), k:=k+1,

      { small:k;

        for(j:k+1, j< size(t)+1, j:=j+1,

           if(t[j] << t[small],

              small:=j,

              void));

        swap(k,small) } );

    t };

  `* SAMPLE CODE *`

  Person(nam,age):[nam,age];

  display(selection([Person("wolfgang",34),Person("isabel",30)], l[2] < r[2]))

}