aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/sortpak.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-06-11 23:00:40 +0000
committerdos-reis <gdr@axiomatics.org>2009-06-11 23:00:40 +0000
commit9e07dcd91c45bf8b22d932321f5c97e931ffe8ac (patch)
tree6d2174e90e5779b1b3ab4ae7df3ae6603b66c6c2 /src/algebra/sortpak.spad.pamphlet
parent7bd82b57975bbc1ff5b87fed0739815c620ecdcc (diff)
downloadopen-axiom-9e07dcd91c45bf8b22d932321f5c97e931ffe8ac.tar.gz
* algebra/: Don't quote '!' at end of names.
Diffstat (limited to 'src/algebra/sortpak.spad.pamphlet')
-rw-r--r--src/algebra/sortpak.spad.pamphlet24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/algebra/sortpak.spad.pamphlet b/src/algebra/sortpak.spad.pamphlet
index 2d10ddf3..c96e3aa1 100644
--- a/src/algebra/sortpak.spad.pamphlet
+++ b/src/algebra/sortpak.spad.pamphlet
@@ -20,39 +20,39 @@ SortPackage(S,A) : Exports == Implementation where
with (finiteAggregate; shallowlyMutable)
Exports == with
- bubbleSort_!: (A,(S,S) -> Boolean) -> A
+ bubbleSort!: (A,(S,S) -> Boolean) -> A
++ bubbleSort!(a,f) \undocumented
- insertionSort_!: (A, (S,S) -> Boolean) -> A
+ insertionSort!: (A, (S,S) -> Boolean) -> A
++ insertionSort!(a,f) \undocumented
if S has OrderedSet then
- bubbleSort_!: A -> A
+ bubbleSort!: A -> A
++ bubbleSort!(a) \undocumented
- insertionSort_!: A -> A
+ insertionSort!: A -> A
++ insertionSort! \undocumented
Implementation == add
- bubbleSort_!(m,f) ==
+ bubbleSort!(m,f) ==
n := #m
for i in 1..(n-1) repeat
for j in n..(i+1) by -1 repeat
- if f(m.j,m.(j-1)) then swap_!(m,j,j-1)
+ if f(m.j,m.(j-1)) then swap!(m,j,j-1)
m
- insertionSort_!(m,f) ==
+ insertionSort!(m,f) ==
for i in 2..#m repeat
j := i
while j > 1 and f(m.j,m.(j-1)) repeat
- swap_!(m,j,j-1)
+ swap!(m,j,j-1)
j := (j - 1) pretend PositiveInteger
m
if S has OrderedSet then
- bubbleSort_!(m) == bubbleSort_!(m,_<$S)
- insertionSort_!(m) == insertionSort_!(m,_<$S)
+ bubbleSort!(m) == bubbleSort!(m,_<$S)
+ insertionSort!(m) == insertionSort!(m,_<$S)
if A has UnaryRecursiveAggregate(S) then
- bubbleSort_!(m,fn) ==
+ bubbleSort!(m,fn) ==
empty? m => m
l := m
while not empty? (r := l.rest) repeat
- r := bubbleSort_!(r,fn)
+ r := bubbleSort!(r,fn)
x := l.first
if fn(r.first,x) then
l.first := r.first