Add documentation and generator.
[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   #:test-condition
9   #:func-that-does-stuff #:noargs #:result-list #:has-no-examples
10   #:values-result #:has-optional #:has-keywords #:has-rest))
11
12 (in-package #:success1)
13
14 (define-condition test-condition nil nil
15  (:documentation
16   "Simple documentation.
17
18 For a simple condition."))
19
20 (defun func-that-does-stuff (path x)
21  "FUNC-THAT-DOES-STUFF PATH X => RESULT
22
23   RESULT: SUCCESS-RESULT | FAILURE-RESULT
24   SUCCESS-RESULT: (:success FILENAME)
25   FAILURE-RESULT: (:failure FILENAME MSG)
26
27 ARGUMENTS AND VALUES:
28
29   PATH: a pathname
30   X: a random value related to PATH
31   FILENAME: the file this func was run on
32   MSG: a string containing the failure message
33
34 DESCRIPTION:
35
36   FUNC-THAT-DOES-STUFF runs all the things against a file and returns
37   as soon as the first func error is found.
38
39   This second section uses PATH and X as something we should talk about, but
40   doesn't use all the arguments (let's include PATH here for fun)
41
42 EXAMPLES:
43
44   (func-that-does-stuff #P\"path/to/file.lisp\" t) => (:success \"path/to/file.lisp\")
45   (func-that-does-stuff #P\"path/to/error.lisp\" nil) => (:failure \"path/to/error.lisp\" \"Error msg\" 20 0)"
46   path)
47
48 (defun result-list ()
49  "RESULT-LIST => RESULT
50
51   RESULT: FAILURE-RESULT*
52   FAILURE-RESULT: (:failure FILENAME MSG)
53
54 ARGUMENTS AND VALUES:
55
56   FILENAME: the file this func was run on
57   MSG: a string containing the failure message
58
59 DESCRIPTION:
60
61   RESULT-LIST runs all the things against a file and returns
62   as soon as the first func error is found."
63   nil)
64
65 (defun noargs ()
66  "NOARGS => RESULT
67
68   RESULT: SUCCESS-RESULT | FAILURE-RESULT
69   SUCCESS-RESULT: (:success FILENAME)
70   FAILURE-RESULT: (:failure FILENAME MSG)
71
72 ARGUMENTS AND VALUES:
73
74   FILENAME: the file this func was run on
75   MSG: a string containing the failure message
76
77 DESCRIPTION:
78
79   NOARGS runs all the things against a file and returns
80   as soon as the first func error is found.
81
82 EXAMPLES:
83
84   (func-that-does-stuff) => (:success \"path/to/file.lisp\")
85   (func-that-does-stuff) => (:failure \"path/to/error.lisp\" \"Error msg\" 20 0)"
86   nil)
87
88 (defun has-no-examples ()
89  "HAS-NO-EXAMPLES => 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   HAS-NO-EXAMPLES runs all the things against a file and returns
103   as soon as the first func error is found."
104   nil)
105
106 (defun values-result ()
107  "VALUES-RESULT => RESULT1, RESULT2, RESULT3
108
109   RESULT1: SUCCESS-RESULT | FAILURE-RESULT
110   SUCCESS-RESULT: (:success FILENAME)
111   FAILURE-RESULT: (:failure FILENAME MSG)
112
113 ARGUMENTS AND VALUES:
114
115   RESULT2: second result
116   RESULT3: third result
117   FILENAME: the file this func was run on
118   MSG: a string containing the failure message
119
120 DESCRIPTION:
121
122   VALUES-RESULT runs all the things against a file and returns
123   as soon as the first func error is found."
124   nil)
125
126 (defun has-optional (path &optional x)
127  "HAS-OPTIONAL PATH &optional X => RESULT
128
129   RESULT: SUCCESS-RESULT | FAILURE-RESULT
130   SUCCESS-RESULT: (:success FILENAME)
131   FAILURE-RESULT: (:failure FILENAME MSG)
132
133 ARGUMENTS AND VALUES:
134
135   PATH: a pathname
136   X: a random value related to PATH
137   FILENAME: the file this func was run on
138   MSG: a string containing the failure message
139
140 DESCRIPTION:
141
142   HAS-OPTIONAL runs all the things against a file and returns
143   as soon as the first func error is found.
144
145   This second section uses PATH and X as something we should talk about, but
146   doesn't use all the arguments (let's include PATH here for fun)"
147   path)
148
149 (defun has-keywords (path &key x)
150  "HAS-KEYWORDS PATH &key 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-KEYWORDS 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-rest (path &rest x)
173  "HAS-REST PATH &rest 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-REST 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)