]> gitweb.factorcode.org Git - factor.git/commitdiff
help: change default effect-help to produce $inputs and $outputs.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 13 Oct 2020 18:26:51 +0000 (11:26 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 13 Oct 2020 18:26:51 +0000 (11:26 -0700)
basis/help/help.factor

index d5125c0a86ffac937f97e1a1bcbb06c9fc6ebf2b..340ca10426477a0617df64587b579a5653fb39f2 100644 (file)
@@ -29,8 +29,8 @@ PRIVATE>
     [ dup "help" word-prop [ ] [ word-help* ] ?if ]
     [ inputs-and-outputs drop ] bi ;
 
-M: word word-help*
-    stack-effect [ in>> ] [ out>> ] bi [
+: effect-help ( effect -- content )
+    [ in>> ] [ out>> ] bi [
         [
             dup pair? [
                 first2 dup effect? [ \ $quotation swap 2array ] when
@@ -38,7 +38,9 @@ M: word word-help*
                 object
             ] if [ effect>string ] dip
         ] { } map>assoc
-    ] bi@ append members \ $values prefix 1array ;
+    ] bi@ \ $inputs \ $outputs [ prefix ] bi-curry@ bi* 2array ;
+
+M: word word-help* stack-effect effect-help ;
 
 : $predicate ( element -- )
     { { "object" object } { "?" boolean } } $values