]> gitweb.factorcode.org Git - factor.git/commitdiff
kernel: Retire $complex-shuffle
authorGiftpflanze <gifti@tools.wmflabs.org>
Tue, 22 Aug 2023 10:16:31 +0000 (12:16 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 22 Aug 2023 15:24:01 +0000 (08:24 -0700)
basis/help/help-docs.factor
basis/help/help.factor
basis/help/lint/checks/checks.factor
basis/help/markup/markup.factor
core/kernel/kernel-docs.factor
extra/help/lint/coverage/coverage.factor
misc/fuel/fuel-markup.el

index 65c5622d7d10184795ce3c71f466f1e0f86a9804..62ccd0c6f074b598c0b29305c2df7bc10fdb7802 100644 (file)
@@ -355,11 +355,6 @@ HELP: $class-description
 { $description "Prints a \"Class Description\" heading, and displays its content." }
 ;
 
-HELP: $complex-shuffle
-{ $values { "element" "a markup element" } }
-{ $description "Used to indicate that a shuffle word is in the " { $link "shuffle-words-complex" } "category." }
-;
-
 HELP: $content
 { $values { "element" "a markup element" } }
 { $description "Prints the content of a help article. The link to the article is given as a string or a word." }
index 29a372aab13896aac877629e371fc64f0bb6b69c..968efcc4a6108835d38cba368765cdd601a18c3c 100644 (file)
@@ -24,7 +24,7 @@ GENERIC: word-help* ( word -- content )
     ] when* ;
 
 : fix-shuffle ( content word -- content' word )
-    over [ { $shuffle $complex-shuffle } member? ] find drop [
+    over [ \ $shuffle = ] find drop [
         '[ _ cut unclip ] dip [
             stack-effect 2array 1array glue
         ] keep
index 612f7a8100923104025de7874a83fbb6b06c5d19..1d40296b72177bd4c01875b9788fc29627022efd 100644 (file)
@@ -84,7 +84,6 @@ SYMBOL: vocab-articles
 : contains-funky-elements? ( element -- ? )
     {
         $shuffle
-        $complex-shuffle
         $values-x/y
         $predicate
         $class-description
index 37ed5a8ad3a67abdc45eedc53abe33b4190edeef..d122897172d613209fa73e6f8522e0e9d8b29fdf 100644 (file)
@@ -452,10 +452,6 @@ M: f ($instance) ($link) ;
     ?first [ ": " swap "." 4array ] [ "." append ] if*
     $description ;
 
-: $complex-shuffle ( element -- )
-    $shuffle
-    { "The data flow represented by this shuffle word might be more clearly expressed using " { $link "locals" } "." } $deprecated ;
-
 : $low-level-note ( children -- )
     drop
     "Calling this word directly is not necessary in most cases. Higher-level words call it automatically." $notes ;
index 5ef5daddafb7e62a81e93f2bf1c7085d5e312e57..ddd97b9657d9d216a2806108545a045f4b0ff665 100644 (file)
@@ -39,14 +39,13 @@ HELP: over  $shuffle ;
 HELP: 2over $shuffle ;
 HELP: pick  $shuffle ;
 HELP: swap  $shuffle ;
-
-HELP: roll  $complex-shuffle ;
-HELP: -roll $complex-shuffle ;
-HELP: tuck  $complex-shuffle ;
-HELP: rot   $complex-shuffle ;
-HELP: -rot  $complex-shuffle ;
-HELP: dupd  $complex-shuffle ;
-HELP: swapd $complex-shuffle ;
+HELP: roll  $shuffle ;
+HELP: -roll $shuffle ;
+HELP: tuck  $shuffle ;
+HELP: rot   $shuffle ;
+HELP: -rot  $shuffle ;
+HELP: dupd  $shuffle ;
+HELP: swapd $shuffle ;
 
 HELP: callstack>array
 { $values { "callstack" callstack } { "array" array } }
@@ -1040,20 +1039,6 @@ HELP: become
 { $values { "old" array } { "new" array } }
 { $description "Replaces all references to objects in " { $snippet "old" } " with the corresponding object in " { $snippet "new" } ". This word is used to implement tuple reshaping. See " { $link "tuple-redefinition" } "." } ;
 
-ARTICLE: "shuffle-words-complex" "Complex shuffle words"
-"These shuffle words tend to make code difficult to read and to reason about. Code that uses them should almost always be rewritten using " { $link "locals" } " or " { $link "dataflow-combinators" } "."
-$nl
-"Duplicating stack elements deep in the stack:"
-{ $subsections
-    dupd
-}
-"Permuting stack elements deep in the stack:"
-{ $subsections
-    swapd
-    rot
-    -rot
-} ;
-
 ARTICLE: "callables" "Callables"
 "Aside from " { $link "quotations" } ", there are two other callables that efficiently combine computations."
 $nl
@@ -1092,9 +1077,15 @@ $nl
 { $subsections
     swap
 }
-"There are additional, more complex stack shuffling words whose use is not recommended."
+"Duplicating stack elements deep in the stack:"
+{ $subsections
+    dupd
+}
+"Permuting stack elements deep in the stack:"
 { $subsections
-    "shuffle-words-complex"
+    swapd
+    rot
+    -rot
 } ;
 
 ARTICLE: "equality" "Equality"
index a87777f5f37913497084cfed5393f72f8d52a798..3766dcc40a12cf087c838fc515f4b2488102cc0b 100644 (file)
@@ -25,7 +25,6 @@ CONSTANT: ignored-words {
     $parsing-note
     $io-error
     $shuffle
-    $complex-shuffle
     $nl
 }
 
index 2fc2b8d6ee56906d30946bd2cb1a2b8efd495a86..de40a184342e8e8e9ae1bceabee05dfd051af48c 100644 (file)
     ($code . (lambda (e) (fuel-markup--code e t)))
     ($command . fuel-markup--command)
     ($command-map . fuel-markup--null)
-    ($complex-shuffle . fuel-markup--complex-shuffle)
     ($contract . fuel-markup--contract)
     ($curious . fuel-markup--curious)
     ($definition . fuel-markup--definition)
@@ -489,15 +488,6 @@ the 'words.' word emits."
     (fuel-markup--list
      (cons '$list (mapcar (lambda (a) (list '$link a a 'author)) authors)))))
 
-(defun fuel-markup--complex-shuffle (e)
-  (fuel-markup--description
-   `($description "Shuffle word. Rearranges the top of the datastack as "
-                  "indicated in the stack effect pattern."))
-  (fuel-markup--elem-with-heading
-   `(nil "The data flow represented by this shuffle word can be more clearly "
-         "expressed using " ($vocab-link "Lexical variables" "locals") ".")
-   "This word is deprecated"))
-
 (defun fuel-markup--list (e)
   (fuel-markup--insert-nl-if-nb)
   (dolist (elt (cdr e))