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