Remove need for ARGUMENTS AND VALUES when there are none
[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 #:no-args-and-values #: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 no-args-and-values ()
112  "NO-ARGS-AND-VALUES => RESULT
113
114   RESULT: :nothing
115
116 DESCRIPTION:
117
118   RESULT-LIST runs all the things against a file and returns
119   as soon as the first func error is found."
120   nil)
121
122 (defun has-no-examples ()
123  "HAS-NO-EXAMPLES => RESULT
124
125   RESULT: SUCCESS-RESULT | FAILURE-RESULT
126   SUCCESS-RESULT: (:success FILENAME)
127   FAILURE-RESULT: (:failure FILENAME MSG)
128
129 ARGUMENTS AND VALUES:
130
131   FILENAME: the file this func was run on
132   MSG: a string containing the failure message
133
134 DESCRIPTION:
135
136   HAS-NO-EXAMPLES runs all the things against a file and returns
137   as soon as the first func error is found."
138   nil)
139
140 (defun values-result ()
141  "VALUES-RESULT => RESULT1, RESULT2, RESULT3
142
143   RESULT1: SUCCESS-RESULT | FAILURE-RESULT
144   SUCCESS-RESULT: (:success FILENAME)
145   FAILURE-RESULT: (:failure FILENAME MSG)
146
147 ARGUMENTS AND VALUES:
148
149   RESULT2: second result
150   RESULT3: third result
151   FILENAME: the file this func was run on
152   MSG: a string containing the failure message
153
154 DESCRIPTION:
155
156   VALUES-RESULT runs all the things against a file and returns
157   as soon as the first func error is found."
158   nil)
159
160 (defun has-optional (path &optional x)
161  "HAS-OPTIONAL PATH &optional X => RESULT
162
163   RESULT: SUCCESS-RESULT | FAILURE-RESULT
164   SUCCESS-RESULT: (:success FILENAME)
165   FAILURE-RESULT: (:failure FILENAME MSG)
166
167 ARGUMENTS AND VALUES:
168
169   PATH: a pathname
170   X: a random value related to PATH
171   FILENAME: the file this func was run on
172   MSG: a string containing the failure message
173
174 DESCRIPTION:
175
176   HAS-OPTIONAL runs all the things against a file and returns
177   as soon as the first func error is found.
178
179   This second section uses PATH and X as something we should talk about, but
180   doesn't use all the arguments (let's include PATH here for fun)"
181   path)
182
183 (defun has-keywords (path &key x)
184  "HAS-KEYWORDS PATH &key X => RESULT
185
186   RESULT: SUCCESS-RESULT | FAILURE-RESULT
187   SUCCESS-RESULT: (:success FILENAME)
188   FAILURE-RESULT: (:failure FILENAME MSG)
189
190 ARGUMENTS AND VALUES:
191
192   PATH: a pathname
193   X: a random value related to PATH
194   FILENAME: the file this func was run on
195   MSG: a string containing the failure message
196
197 DESCRIPTION:
198
199   HAS-KEYWORDS runs all the things against a file and returns
200   as soon as the first func error is found.
201
202   This second section uses PATH and X as something we should talk about, but
203   doesn't use all the arguments (let's include PATH here for fun)"
204   path)
205
206 (defun has-rest (path &rest x)
207  "HAS-REST PATH &rest X => RESULT
208
209   RESULT: SUCCESS-RESULT | FAILURE-RESULT
210   SUCCESS-RESULT: (:success FILENAME)
211   FAILURE-RESULT: (:failure FILENAME MSG)
212
213 ARGUMENTS AND VALUES:
214
215   PATH: a pathname
216   X: a random value related to PATH
217   FILENAME: the file this func was run on
218   MSG: a string containing the failure message
219
220 DESCRIPTION:
221
222   HAS-REST runs all the things against a file and returns
223   as soon as the first func error is found.
224
225   This second section uses PATH and X as something we should talk about, but
226   doesn't use all the arguments (let's include PATH here for fun)"
227   path)