]> gitweb.factorcode.org Git - factor.git/blob - core/system/system-docs.factor
Solution to Project Euler problem 65
[factor.git] / core / system / system-docs.factor
1 USING: generic help.markup help.syntax kernel math memory
2 namespaces sequences kernel.private strings classes.singleton ;
3 IN: system
4
5 ABOUT: "system"
6
7 ARTICLE: "system" "System interface"
8 { $subsection "cpu" }
9 { $subsection "os" }
10 "Getting the path to the Factor VM and image:"
11 { $subsection vm }
12 { $subsection image }
13 "Getting the current time:"
14 { $subsection micros }
15 { $subsection millis }
16 "Exiting the Factor VM:"
17 { $subsection exit } ;
18
19 ARTICLE: "cpu" "Processor detection"
20 "Processor detection:"
21 { $subsection cpu }
22 "Supported processors:"
23 { $subsection x86.32 }
24 { $subsection x86.64 }
25 { $subsection ppc }
26 { $subsection arm }
27 "Processor families:"
28 { $subsection x86 } ;
29
30 ARTICLE: "os" "Operating system detection"
31 "Operating system detection:"
32 { $subsection os }
33 "Supported operating systems:"
34 { $subsection freebsd }
35 { $subsection linux }
36 { $subsection macosx }
37 { $subsection openbsd }
38 { $subsection netbsd }
39 { $subsection solaris }
40 { $subsection wince }
41 { $subsection winnt }
42 "Operating system families:"
43 { $subsection bsd }
44 { $subsection unix }
45 { $subsection windows } ;
46
47
48 HELP: cpu
49 { $values { "class" singleton-class } }
50 { $description
51     "Outputs a singleton class with the name of the current CPU architecture."
52 } ;
53
54 HELP: os
55 { $values { "class" singleton-class } }
56 { $description
57     "Outputs a singleton class with the name of the current operating system family."
58 } ;
59
60 HELP: embedded?
61 { $values { "?" "a boolean" } }
62 { $description "Tests if this Factor instance is embedded in another application." } ;
63
64 HELP: exit ( n -- )
65 { $values { "n" "an integer exit code" } }
66 { $description "Exits the Factor process." } ;
67
68 HELP: micros ( -- us )
69 { $values { "us" integer } }
70 { $description "Outputs the number of microseconds ellapsed since midnight January 1, 1970." }
71 { $notes "This is a low-level word. The " { $vocab-link "calendar" } " vocabulary provides features for date/time arithmetic and formatting." } ;
72
73 HELP: millis ( -- ms )
74 { $values { "ms" integer } }
75 { $description "Outputs the number of milliseconds ellapsed since midnight January 1, 1970." }
76 { $notes "This is a low-level word. The " { $vocab-link "calendar" } " vocabulary provides features for date/time arithmetic and formatting." } ;
77
78 HELP: image
79 { $values { "path" "a pathname string" } }
80 { $description "Outputs the pathname of the currently running Factor image." } ;
81
82 HELP: vm
83 { $values { "path" "a pathname string" } }
84 { $description "Outputs the pathname of the currently running Factor VM." } ;