# Changeset 34294 in project

Ignore:
Timestamp:
08/20/17 11:46:44 (21 months ago)
Message:

man/5: Add Module (chicken sort) chapter

Location:
wiki/man/5
Files:
4 edited

Unmodified
Removed
• ## wiki/man/5/Module (chicken repl)

 r34288 Previous: [[Module (chicken read-syntax)]] Next: [[Module (chicken syntax)]] Next: [[Module (chicken sort)]]
• ## wiki/man/5/Module (chicken syntax)

 r34052 --- Previous: [[Module (chicken repl)]] Previous: [[Module (chicken sort)]] Next: [[Module (chicken tcp)]]
• ## wiki/man/5/TODO/Unit data-structures

 r34052 Returns true if {{X}} is one of the tails (cdr's) of {{LIST}}. === Sorting ==== merge (merge LIST1 LIST2 LESS?)
(merge! LIST1 LIST2 LESS?) Joins two lists in sorted order. {{merge!}} is the destructive version of merge. {{LESS?  }} should be a procedure of two arguments, that returns true if the first argument is to be ordered before the second argument. ==== sort (sort SEQUENCE LESS?)
(sort! SEQUENCE LESS?) Sort {{SEQUENCE}}, which should be a list or a vector. {{sort!}} is the destructive version of sort. ==== sorted? (sorted? SEQUENCE LESS?) Returns true if the list or vector {{SEQUENCE}} is already sorted. ==== topological-sort (topological-sort DAG PRED) Sorts the directed acyclic graph dag {{DAG}} so that for every edge from vertex u to v, u will come before v in the resulting list of vertices. {{DAG}} is a list of sublists. The car of each sublist is a vertex. The cdr is the adjacency list of that vertex, i.e. a list of all vertices to which there exists an edge from the car vertex. {{pred}} is procedure of two arguments that should compare vertices for equality. Time complexity: O (|V| + |E|) (topological-sort '((shirt tie belt) (tie jacket) (belt jacket) (watch) (pants shoes belt) (undershorts pants shoes) (socks shoes)) eq?) => (socks undershorts pants shoes watch shirt belt tie jacket) If a cycle is detected during the sorting process, an exception of the condition kinds {{(exn runtime cycle)}} is thrown.
• ## wiki/man/5/TODO/new-manual.org

 r34271 ** Module (chicken read-syntax) : Creating syntactic extensions to the reader ** Module (chicken repl) : Creating a Read-Eval-Print Loop ** Module (chicken sort) : Sorting lists and vectors ** Module (chicken syntax) : Creating syntactic extensions (macros) ** Module (chicken tcp) : Connecting over the network via TCP
Note: See TracChangeset for help on using the changeset viewer.