Improve example in syntax vocab

db4
Slava Pestov 2009-04-20 01:42:54 -05:00
parent 0c4d9617f6
commit bcd0533794
1 changed files with 13 additions and 5 deletions

View File

@ -525,11 +525,19 @@ HELP: ((
{ $description "Literal stack effect syntax." } { $description "Literal stack effect syntax." }
{ $notes "Useful for meta-programming with " { $link define-declared } "." } { $notes "Useful for meta-programming with " { $link define-declared } "." }
{ $examples { $examples
{ $code { $example
"<< SYMBOL: my-dynamic-word" "USING: compiler.units kernel math prettyprint random words ;"
"USING: math random words ;" "IN: scratchpad"
"my-dynamic-word 3 { [ + ] [ - ] [ * ] [ / ] } random curry" ""
"(( x -- y )) define-declared >>" "SYMBOL: my-dynamic-word"
""
"["
" my-dynamic-word 2 { [ + ] [ * ] } random curry"
" (( x -- y )) define-declared"
"] with-compilation-unit"
""
"2 my-dynamic-word ."
"4"
} }
} ; } ;