Sort (Kernel)

Sort(source dest orderFunction)


SCI1.1 only.

Sorts a list and puts the result into another list.

  • source (k_list) – The list of items to sort.
  • dest (k_list) – The destination list. The list may be the same as the source list.
  • orderFunction (heapPtr) – An instance of an object with a doit() method (e.g. Code) that returns a numerical value indicating order.


(instance sortByDistanceToEgo of Code
        (method (doit theObj)
                (return (gEgo distanceTo: theObj))

; Then somewhere in the script:
(Sort myEventHandler myEventHandler sortByDistanceToEgo)