]> gitweb.factorcode.org Git - factor.git/blob - basis/eval/eval-docs.factor
merge project-euler.factor
[factor.git] / basis / eval / eval-docs.factor
1 IN: eval
2 USING: help.markup help.syntax strings io effects ;
3
4 HELP: eval
5 { $values { "str" string } { "effect" effect } }
6 { $description "Parses Factor source code from a string, and calls the resulting quotation, which must have the given stack effect." }
7 { $errors "Throws an error if the input is malformed, or if the evaluation itself throws an error." } ;
8
9 HELP: eval(
10 { $syntax "eval( inputs -- outputs )" }
11 { $description "Parses Factor source code from the string at the top of the stack, and calls the resulting quotation, which must have the given stack effect." }
12 { $errors "Throws an error if the input is malformed, or if the evaluation itself throws an error." } ;
13
14 HELP: eval>string
15 { $values { "str" string } { "output" string } }
16 { $description "Evaluates the Factor code in " { $snippet "str" } " with " { $link output-stream } " rebound to a string output stream, then outputs the resulting string. The code in the string must not take or leave any values on the stack." } ;
17
18 ARTICLE: "eval" "Evaluating strings at runtime"
19 "The " { $vocab-link "eval" } " vocabulary implements support for evaluating strings at runtime."
20 { $subsections
21     POSTPONE: eval(
22     eval>string
23 } ;
24
25 ABOUT: "eval"