factor/doc/handbook/handbook.facts

47 lines
1.9 KiB
Plaintext
Raw Normal View History

2006-03-25 17:01:39 -05:00
USING: help inspector parser prettyprint ;
2006-01-13 02:38:57 -05:00
ARTICLE: "handbook" "Factor documentation"
2006-03-25 03:16:25 -05:00
"Welcome to Factor!"
2006-01-14 17:50:59 -05:00
$terpri
2006-03-25 17:01:39 -05:00
"The Factor user interface centers on the concept of a " { $emphasis "presentation" } ". A presentation is a graphical view of a live object."
$terpri
"Placing the mouse over a presentation highlights it with a border. Presentations are everywhere; help links, words, and code examples are all presentations. Clicking a presentation displays a browser window looking at the underlying object. A left click will reuse the current browser window; a right click always opens a new window."
$terpri
2006-03-25 03:16:25 -05:00
"Introductory material:"
2006-01-13 02:38:57 -05:00
{ $subsection "tutorial" }
2006-01-14 17:50:59 -05:00
{ $subsection "quickref" }
2006-01-19 18:15:37 -05:00
"Detailed reference documentation:"
2006-01-13 02:38:57 -05:00
{ $subsection "syntax" }
{ $subsection "dataflow" }
{ $subsection "words" }
{ $subsection "objects" }
{ $subsection "math" }
{ $subsection "collections" }
{ $subsection "streams" }
2006-01-19 18:15:37 -05:00
{ $subsection "parser" }
{ $subsection "prettyprint" }
2006-03-25 03:16:25 -05:00
{ $subsection "tools" } ;
2006-01-13 02:38:57 -05:00
2006-01-14 17:50:59 -05:00
ARTICLE: "quickref" "Quick reference"
2006-03-25 17:01:39 -05:00
"Loading source files:"
{ $subsection run-file }
"Displaying word documentation:"
{ $subsection help }
"Printing the top of the stack, and displaying the stack without popping:"
{ $subsection . }
{ $subsection .s }
2006-01-14 17:50:59 -05:00
"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>" }
$terpri
"A simple program:"
{ $code
"USING: kernel math ;"
": factorial ( n -- n! )"
" dup zero? [ drop 1 ] [ dup 1- factorial * ] if ;"
} ;