Add variable documentation
[sheep] / resources / success1.lisp
1 (defpackage #:success1 (:use :cl)
2  (:documentation
3 "This defines a simple successful package.
4
5 This is should all get pulled in and the markdown.md should be equal
6 to success1.md.")
7  (:export
8   #:*special-variable*
9   #:test-condition
10   #:func-that-does-stuff #:noargs #:result-list #:has-no-examples
11   #:values-result #:has-optional #:has-keywords #:has-rest))
12
13 (in-package #:success1)
14
15 (defvar *special-variable* nil
16  "*SPECIAL-VARIABLE*
17
18 VALUE TYPE:
19
20   a generalized boolean
21
22 INITIAL VALUE:
23
24   NIL
25
26 DESCRIPTION:
27
28   It is special, and a boolean.
29
30   When true, it satisfies if coniditions.  When NIL, it does not.
31   That may make it seem like it's not very special, but it is.
32
33 EXAMPLES:
34
35   (let ((*special-variable* t)) (go)) => 'let-it-go")
36
37 (define-condition test-condition nil nil
38  (:documentation
39   "Simple documentation.
40
41 For a simple condition."))
42
43 (defun func-that-does-stuff (path x)
44  "FUNC-THAT-DOES-STUFF PATH X => RESULT
45
46   RESULT: SUCCESS-RESULT | FAILURE-RESULT
47   SUCCESS-RESULT: (:success FILENAME)
48   FAILURE-RESULT: (:failure FILENAME MSG)
49
50 ARGUMENTS AND VALUES:
51
52   PATH: a pathname
53   X: a random value related to PATH
54   FILENAME: the file this func was run on
55   MSG: a string containing the failure message
56
57 DESCRIPTION:
58
59   FUNC-THAT-DOES-STUFF runs all the things against a file and returns
60   as soon as the first func error is found.
61
62   This second section uses PATH and X as something we should talk about, but
63   doesn't use all the arguments (let's include PATH here for fun)
64
65 EXAMPLES:
66
67   (func-that-does-stuff #P\"path/to/file.lisp\" t) => (:success \"path/to/file.lisp\")
68   (func-that-does-stuff #P\"path/to/error.lisp\" nil) => (:failure \"path/to/error.lisp\" \"Error msg\" 20 0)"
69   path)
70
71 (defun result-list ()
72  "RESULT-LIST => RESULT
73
74   RESULT: FAILURE-RESULT*
75   FAILURE-RESULT: (:failure FILENAME MSG)
76
77 ARGUMENTS AND VALUES:
78
79   FILENAME: the file this func was run on
80   MSG: a string containing the failure message
81
82 DESCRIPTION:
83
84   RESULT-LIST runs all the things against a file and returns
85   as soon as the first func error is found."
86   nil)
87
88 (defun noargs ()
89  "NOARGS => RESULT
90
91   RESULT: SUCCESS-RESULT | FAILURE-RESULT
92   SUCCESS-RESULT: (:success FILENAME)
93   FAILURE-RESULT: (:failure FILENAME MSG)
94
95 ARGUMENTS AND VALUES:
96
97   FILENAME: the file this func was run on
98   MSG: a string containing the failure message
99
100 DESCRIPTION:
101
102   NOARGS runs all the things against a file and returns
103   as soon as the first func error is found.
104
105 EXAMPLES:
106
107   (func-that-does-stuff) => (:success \"path/to/file.lisp\")
108   (func-that-does-stuff) => (:failure \"path/to/error.lisp\" \"Error msg\" 20 0)"
109   nil)
110
111 (defun has-no-examples ()
112  "HAS-NO-EXAMPLES => RESULT
113
114   RESULT: SUCCESS-RESULT | FAILURE-RESULT
115   SUCCESS-RESULT: (:success FILENAME)
116   FAILURE-RESULT: (:failure FILENAME MSG)
117
118 ARGUMENTS AND VALUES:
119
120   FILENAME: the file this func was run on
121   MSG: a string containing the failure message
122
123 DESCRIPTION:
124
125   HAS-NO-EXAMPLES runs all the things against a file and returns
126   as soon as the first func error is found."
127   nil)
128
129 (defun values-result ()
130  "VALUES-RESULT => RESULT1, RESULT2, RESULT3
131
132   RESULT1: SUCCESS-RESULT | FAILURE-RESULT
133   SUCCESS-RESULT: (:success FILENAME)
134   FAILURE-RESULT: (:failure FILENAME MSG)
135
136 ARGUMENTS AND VALUES:
137
138   RESULT2: second result
139   RESULT3: third result
140   FILENAME: the file this func was run on
141   MSG: a string containing the failure message
142
143 DESCRIPTION:
144
145   VALUES-RESULT runs all the things against a file and returns
146   as soon as the first func error is found."
147   nil)
148
149 (defun has-optional (path &optional x)
150  "HAS-OPTIONAL PATH &optional X => RESULT
151
152   RESULT: SUCCESS-RESULT | FAILURE-RESULT
153   SUCCESS-RESULT: (:success FILENAME)
154   FAILURE-RESULT: (:failure FILENAME MSG)
155
156 ARGUMENTS AND VALUES:
157
158   PATH: a pathname
159   X: a random value related to PATH
160   FILENAME: the file this func was run on
161   MSG: a string containing the failure message
162
163 DESCRIPTION:
164
165   HAS-OPTIONAL runs all the things against a file and returns
166   as soon as the first func error is found.
167
168   This second section uses PATH and X as something we should talk about, but
169   doesn't use all the arguments (let's include PATH here for fun)"
170   path)
171
172 (defun has-keywords (path &key x)
173  "HAS-KEYWORDS PATH &key X => RESULT
174
175   RESULT: SUCCESS-RESULT | FAILURE-RESULT
176   SUCCESS-RESULT: (:success FILENAME)
177   FAILURE-RESULT: (:failure FILENAME MSG)
178
179 ARGUMENTS AND VALUES:
180
181   PATH: a pathname
182   X: a random value related to PATH
183   FILENAME: the file this func was run on
184   MSG: a string containing the failure message
185
186 DESCRIPTION:
187
188   HAS-KEYWORDS runs all the things against a file and returns
189   as soon as the first func error is found.
190
191   This second section uses PATH and X as something we should talk about, but
192   doesn't use all the arguments (let's include PATH here for fun)"
193   path)
194
195 (defun has-rest (path &rest x)
196  "HAS-REST PATH &rest X => RESULT
197
198   RESULT: SUCCESS-RESULT | FAILURE-RESULT
199   SUCCESS-RESULT: (:success FILENAME)
200   FAILURE-RESULT: (:failure FILENAME MSG)
201
202 ARGUMENTS AND VALUES:
203
204   PATH: a pathname
205   X: a random value related to PATH
206   FILENAME: the file this func was run on
207   MSG: a string containing the failure message
208
209 DESCRIPTION:
210
211   HAS-REST runs all the things against a file and returns
212   as soon as the first func error is found.
213
214   This second section uses PATH and X as something we should talk about, but
215   doesn't use all the arguments (let's include PATH here for fun)"
216   path)