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