Improve example in syntax vocab
parent
0c4d9617f6
commit
bcd0533794
|
@ -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"
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue