-
Notifications
You must be signed in to change notification settings - Fork 86
sort
Chris Petersen edited this page Oct 16, 2014
·
1 revision
sort sorts a list using the comparison operator cmp, which can be a function.
Parameter | Description |
---|---|
lst | List to be sorted |
cmp | Comparison operator or function to be used for sorting |
Example 1: Sort a list of numbers
> (define lst (list 5 1 4 3 2 6))
> (sort lst <)
(1 2 3 4 5 6)
Example 2: Sort a list of lists by the second element of that list
> (define lst (list (list 2 1) (list 3 5) (list 1 0)))
> (sort lst (lambda (a b) (< (cadr a) (cadr b))))
((1 0) (2 1) (3 5))
-
- accelerometer
- alist
- audio
- audioaux
- base64
- btle-scan
- camera
- cdb
- cgi
- config
- csv
- curl
- digest
- dmtx
- download
- eventloop
- fcgi
- fft
- generalized-arrays
- gps
- graph
- gyro
- hidapi
- hpdf
- html
- httpsclient
- hybridapp
- json
- lmdb
- ln_core
- ln_glcore
- ln_glgui
- ln_store
- localization
- localization_gui
- localnotification
- magnetometer
- mdns
- mqtt
- mqtt-store
- multitouch
- oauth
- orientation
- p256ecdsa
- png
- portaudio
- pregexp
- pressure
- prime
- pushnotification
- redcap
- rsa
- rtaudio
- rupi
- rotation
- sanestring
- scheduler
- serial
- sets
- settings
- simplexnoise
- sqlite
- ssax
- syntax-case
- timestamp
- ttf
- uiform
- url
- uuid
- vibrate
- videoplayer
- watchdog
- website
- xml
- zip