Category:CafeOBJ: Difference between revisions
m
→Examples
m (→Examples) |
|||
(One intermediate revision by the same user not shown) | |||
Line 32:
</syntaxhighlight >
Below is a idiosyncratic sorting program. See [https://rosettacode.org/wiki/Sorting_algorithms/Quicksort#CafeOBJ] for more traditional quicksort program.
<syntaxhighlight lang="$CafeOBJ">
Line 55:
-- The program is in the form of a single conditional equation, which will swap N and N' if N is larger or equal to N'.
-- There is no need for an intermediate variable to do the swap.
ceq [swap] : (N N') = (N' N) if N' <
}
|