]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/interpolate/interpolate-docs.factor
interpolate: allow mixing of named variables and stack arguments.
[factor.git] / basis / interpolate / interpolate-docs.factor
index 02300ea282c321e9a52c394ae741d126552b2367..6953266edd54735f9ad0b7f4d48e0219f32b2691 100644 (file)
@@ -1,10 +1,24 @@
-USING: help.markup help.syntax math strings ;
+USING: help.markup help.syntax io math strings ;
 IN: interpolate
 
-HELP: ninterpolate
-{ $values { "str" string } { "n" integer } }
-{ $description "Assigns stack arguments to numbered variables for string interpolation." }
+HELP: interpolate.
+{ $values { "str" string } }
+{ $description "String interpolation using named variables and/or stack arguments, writing to the " { $link output-stream } "." }
 { $examples
-    { $example "USING: interpolate ;" "\"Bob\" \"Alice\" \"Hi ${0}, it's ${1}.\" 2 ninterpolate" "Hi Bob, it's Alice." }
-}
-{ $see-also interpolate } ;
+    { $example
+        "USING: interpolate ;"
+        "\"Bob\" \"Alice\" \"Hi ${0}, it's ${1}.\" interpolate."
+        "Hi Bob, it's Alice."
+    }
+    { $example
+        "USING: interpolate namespaces ;"
+        "\"Fred\" \"name\" [ \"Hi ${name}\" interpolate. ] with-variable"
+        "Hi Fred"
+    }
+} ;
+
+HELP: interpolate
+{ $values { "str" string } { "newstr" string } }
+{ $description "String interpolation using named variables and/or stack arguments, captured as a " { $link string } "." } ;
+
+{ interpolate interpolate. } related-words