1 ! Copyright (C) 2008 Joe Groff.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax multiline ;
8 { $description "Executes " { $snippet "word" } " at parse time and adds the result(s) to the parser accumulator." }
9 { $notes "Since " { $snippet "word" } " is executed at parse time, " { $snippet "$" } " cannot be used with words defined in the same compilation unit." }
13 USING: kernel literals prettyprint ;
21 USING: kernel literals prettyprint ;
24 << : seven-eleven 7 11 ; >>
31 { $syntax "$[ code ]" }
32 { $description "Calls " { $snippet "code" } " at parse time and adds the result(s) to the parser accumulator." }
33 { $notes "Since " { $snippet "code" } " is executed at parse time, it cannot reference any words defined in the same compilation unit." }
37 USING: kernel literals math prettyprint ;
41 { $[ five dup 1+ dup 2 + ] } .
46 { POSTPONE: $ POSTPONE: $[ } related-words
48 ARTICLE: "literals" "Interpolating code results into literal values"
49 "The " { $vocab-link "literals" } " vocabulary contains words to run code at parse time and insert the results into more complex literal values."
51 USING: kernel literals math prettyprint ;
55 { $ five $[ five dup 1+ dup 2 + ] } .
57 { $subsection POSTPONE: $ }
58 { $subsection POSTPONE: $[ }