minor tweaks, add missing file
parent
5784027842
commit
b757202a07
|
@ -1,23 +1,13 @@
|
||||||
USING: help parser prettyprint ;
|
USING: help parser prettyprint ;
|
||||||
|
|
||||||
ARTICLE: "handbook" "Factor documentation"
|
ARTICLE: "handbook" "Factor documentation"
|
||||||
"Welcome to Factor! Factor documentation is takes the form of an outline, with cross-referencing hyperlinks between topics. You can click the triangle next to a topic heading to expand the topic:"
|
"Welcome to Factor! Factor documentation is takes the form of an outline, with cross-referencing hyperlinks between topics. You can click the triangle next to a topic heading to expand the topic."
|
||||||
|
$terpri
|
||||||
|
"There is some introductory material you will find useful when starting out:"
|
||||||
{ $subsection "presentation-intro" }
|
{ $subsection "presentation-intro" }
|
||||||
"There is a short language tutorial:"
|
|
||||||
{ $subsection "tutorial" }
|
{ $subsection "tutorial" }
|
||||||
"Some words for performing common operations at the listener:"
|
{ $subsection "quickref" }
|
||||||
{ $list
|
"More detailed reference documentation:"
|
||||||
{
|
|
||||||
"You can read the documentation for a word with " { $link help } ":"
|
|
||||||
{ $code "\\ reverse help" }
|
|
||||||
}
|
|
||||||
{ "You can print the top of the stack with " { $link . } }
|
|
||||||
{
|
|
||||||
"Source files are loaded with " { $link run-file } ":"
|
|
||||||
{ $code "\"tetris.factor\" run-file" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"Detailed documentation:"
|
|
||||||
{ $subsection "syntax" }
|
{ $subsection "syntax" }
|
||||||
{ $subsection "dataflow" }
|
{ $subsection "dataflow" }
|
||||||
{ $subsection "words" }
|
{ $subsection "words" }
|
||||||
|
@ -32,3 +22,24 @@ $terpri
|
||||||
"When you place the mouse over a presentation, it is highlighted with a surrounding border."
|
"When you place the mouse over a presentation, it is highlighted with a surrounding border."
|
||||||
$terpri
|
$terpri
|
||||||
"Clicking a presentation with the left mouse button invokes a default command. Clicking the right mouse button displays a menu of applicable commands." ;
|
"Clicking a presentation with the left mouse button invokes a default command. Clicking the right mouse button displays a menu of applicable commands." ;
|
||||||
|
|
||||||
|
ARTICLE: "quickref" "Quick reference"
|
||||||
|
"Some words for performing common operations at the listener:"
|
||||||
|
{ $list
|
||||||
|
{
|
||||||
|
"You can read the documentation for a word with " { $link help } ":"
|
||||||
|
{ $code "\\ reverse help" }
|
||||||
|
}
|
||||||
|
{ "You can print the top of the stack with " { $link . } }
|
||||||
|
{
|
||||||
|
"Source files are loaded with " { $link run-file } ":"
|
||||||
|
{ $code "\"tetris.factor\" run-file" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"If you enter an invalid word name, you will get a \"not a number\" error:"
|
||||||
|
{ $example
|
||||||
|
"fdafasfa"
|
||||||
|
"An unhandled error was caught:\n\nParsing <interactive>:1\nfdafasfa\n ^\n\"Not a number\"\n\n:s :r show stacks at time of error.\n:get ( var -- value ) inspects the error namestack."
|
||||||
|
}
|
||||||
|
"Sometimes, the word " { $emphasis "does" } " exist, but you might need to " { $link POSTPONE: USE: } " its vocabulary first. The " { $link apropos } " word can help locate the correct vocabulary:"
|
||||||
|
{ $example "\"<label>\" apropos" "IN: gadgets-labels : <label>\nIN: compiler-backend : <label>" } ;
|
||||||
|
|
|
@ -27,7 +27,9 @@ PREDICATE: array simple-element
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
M: string print-element
|
M: string print-element
|
||||||
" " split [ write-term ] [ bl ] interleave ;
|
" " split
|
||||||
|
[ dup empty? [ drop ] [ write-term ] if ]
|
||||||
|
[ bl ] interleave ;
|
||||||
|
|
||||||
M: array print-element
|
M: array print-element
|
||||||
unswons* execute ;
|
unswons* execute ;
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
USING: help kernel-internals math ;
|
||||||
|
|
||||||
|
HELP: cells "( m -- n )"
|
||||||
|
{ $values { "m" "an integer" } { "n" "an integer" } }
|
||||||
|
{ $description "Computes the number of bytes corresponding to " { $snippet "m" } " CPU operand-sized cells." } ;
|
||||||
|
|
||||||
|
HELP: cell-bits "( m -- n )"
|
||||||
|
{ $values { "m" "an integer" } { "n" "an integer" } }
|
||||||
|
{ $description "Computes the number of bits corresponding to " { $snippet "m" } " CPU operand-sized cells." } ;
|
||||||
|
|
||||||
|
HELP: i "( -- i )"
|
||||||
|
{ $values { "i" "the imaginary unit" } } ;
|
||||||
|
|
||||||
|
HELP: -i "( -- -i )"
|
||||||
|
{ $values { "i" "the negated imaginary unit" } } ;
|
||||||
|
|
||||||
|
HELP: inf "( -- inf )"
|
||||||
|
{ $values { "inf" "floating point positive infinity" } } ;
|
||||||
|
|
||||||
|
HELP: -inf "( -- -inf )"
|
||||||
|
{ $values { "-inf" "floating point negative infinity" } } ;
|
||||||
|
|
||||||
|
HELP: e "( -- e )"
|
||||||
|
{ $values { "e" "base of natural logarithm" } } ;
|
||||||
|
|
||||||
|
HELP: pi "( -- pi )"
|
||||||
|
{ $values { "pi" "circumference of circle with diameter 1" } } ;
|
||||||
|
|
||||||
|
HELP: epsilon "( -- epsilon )"
|
||||||
|
{ $values { "epsilon" "smallest floating point value you can add to 1 without underflow" } } ;
|
||||||
|
|
||||||
|
HELP: first-bignum "( -- n )"
|
||||||
|
{ $values { "n" "smallest positive integer not representable by a fixnum" } } ;
|
||||||
|
|
||||||
|
HELP: most-positive-fixnum "( -- n )"
|
||||||
|
{ $values { "n" "largest positive integer representable by a fixnum" } } ;
|
||||||
|
|
||||||
|
HELP: most-negative-fixnum "( -- n )"
|
||||||
|
{ $values { "n" "smallest negative integer representable by a fixnum" } } ;
|
|
@ -40,13 +40,14 @@ M: gadget-stream stream-write1 ( char stream -- )
|
||||||
presented [ <command-button> ] apply-style ;
|
presented [ <command-button> ] apply-style ;
|
||||||
|
|
||||||
: apply-break-style ( style gadget -- style gadget )
|
: apply-break-style ( style gadget -- style gadget )
|
||||||
word-break [ <word-break-gadget> ] apply-style ;
|
word-break [ drop <word-break-gadget> ] apply-style ;
|
||||||
|
|
||||||
: <presentation> ( style text -- gadget )
|
: <presentation> ( style text -- gadget )
|
||||||
<label>
|
<label>
|
||||||
apply-foreground-style
|
apply-foreground-style
|
||||||
apply-background-style
|
apply-background-style
|
||||||
apply-font-style
|
apply-font-style
|
||||||
|
apply-break-style
|
||||||
apply-command-style
|
apply-command-style
|
||||||
nip ;
|
nip ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue