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

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

`*         Wolfgang De Meuter        *`

`*  VUB Programming Technology Lab   *`

`*               ©2004               *`

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

`*  Generic Insertion Sort Routine   *`

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

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

    for(k:size(t), k> 0, k:=k-1, {

      j:k+1;

      save:t[k];

      while((j<size(t)+1) & (t[j]<<save) , {

        t[j-1]:=t[j];

        j:=j+1 });

      t[j-1]:=save });

    t };

  `* SAMPLE CODE *`

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

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

}