]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/koszul/koszul.factor
Rename and add sorting words
[factor.git] / extra / koszul / koszul.factor
index 1c6ef39f81ce46355a97d6374a0fc55d6bd772a7..de1cf4fc9281c327f9dbf234527adb0c1f7d4911 100644 (file)
@@ -68,7 +68,7 @@ SYMBOL: terms
     ] if ;
 
 : permutation ( seq -- perm )
-    [ natural-sort ] keep [ index ] curry map ;
+    [ sort ] keep [ index ] curry map ;
 
 : (inversions) ( n seq -- n )
     [ > ] with count ;
@@ -83,7 +83,7 @@ SYMBOL: terms
         2drop 0 { }
     ] [
         dup permutation inversions -1^ rot *
-        swap natural-sort
+        swap sort
     ] if ;
 
 : wedge ( x y -- x.y )
@@ -147,11 +147,11 @@ DEFER: (d)
     ] map sift 2nip ;
 
 : basis ( generators -- seq )
-    natural-sort dup length 2^ <iota> [ nth-basis-elt ] with map ;
+    sort dup length 2^ <iota> [ nth-basis-elt ] with map ;
 
 : (tensor) ( seq1 seq2 -- seq )
     [
-        [ prepend natural-sort ] curry map
+        [ prepend sort ] curry map
     ] with map concat ;
 
 : tensor ( graded-basis1 graded-basis2 -- bigraded-basis )