1 (defpackage #:success1 (:use :cl)
3 "This defines a simple successful package.
5 This is should all get pulled in and the markdown.md should be equal
12 #:func-that-does-stuff #:noargs #:no-args-and-values #:result-list #:has-no-examples
13 #:values-result #:has-optional #:has-keywords #:has-rest))
15 (in-package #:success1)
17 (defvar *special-variable* nil
30 It is special, and a boolean.
32 When true, it satisfies if coniditions. When NIL, it does not.
33 That may make it seem like it's not very special, but it is.
35 But sometimes it needs to reference itself: *SPECIAL-VARIABLE*
39 (let ((*special-variable* t)) (go)) => 'let-it-go")
41 (defvar *special-variable-2* nil
54 It is special, and a boolean.")
56 (define-condition test-condition nil nil
58 "Simple documentation.
60 For a simple condition."))
62 (defstruct test-struct
63 "Simple documentation.
65 For a simple structure. But this structure may go to two lines
66 for this part of it.")
68 (defun func-that-does-stuff (path x)
69 "FUNC-THAT-DOES-STUFF PATH X => RESULT
71 RESULT: SUCCESS-RESULT | FAILURE-RESULT
72 SUCCESS-RESULT: (:success FILENAME)
73 FAILURE-RESULT: (:failure FILENAME MSG)
78 X: a random value related to PATH
79 FILENAME: the file this func was run on
80 MSG: a string containing the failure message
84 FUNC-THAT-DOES-STUFF runs all the things against a file and returns
85 as soon as the first func error is found.
87 This second section uses PATH and X as something we should talk about, but
88 doesn't use all the arguments (let's include PATH here for fun)
92 (func-that-does-stuff #P\"path/to/file.lisp\" t) => (:success \"path/to/file.lisp\")
93 (func-that-does-stuff #P\"path/to/error.lisp\" nil) => (:failure \"path/to/error.lisp\" \"Error msg\" 20 0)"
97 "RESULT-LIST => RESULT
99 RESULT: FAILURE-RESULT*
100 FAILURE-RESULT: (:failure FILENAME MSG)
102 ARGUMENTS AND VALUES:
104 FILENAME: the file this func was run on
105 MSG: a string containing the failure message
109 RESULT-LIST runs all the things against a file and returns
110 as soon as the first func error is found."
116 RESULT: SUCCESS-RESULT | FAILURE-RESULT
117 SUCCESS-RESULT: (:success FILENAME)
118 FAILURE-RESULT: (:failure FILENAME MSG)
120 ARGUMENTS AND VALUES:
122 FILENAME: the file this func was run on
123 MSG: a string containing the failure message
127 NOARGS runs all the things against a file and returns
128 as soon as the first func error is found.
132 (func-that-does-stuff) => (:success \"path/to/file.lisp\")
133 (func-that-does-stuff) => (:failure \"path/to/error.lisp\" \"Error msg\" 20 0)"
136 (defun no-args-and-values ()
137 "NO-ARGS-AND-VALUES => RESULT
143 RESULT-LIST runs all the things against a file and returns
144 as soon as the first func error is found."
147 (defun has-no-examples ()
148 "HAS-NO-EXAMPLES => RESULT
150 RESULT: SUCCESS-RESULT | FAILURE-RESULT
151 SUCCESS-RESULT: (:success FILENAME)
152 FAILURE-RESULT: (:failure FILENAME MSG)
154 ARGUMENTS AND VALUES:
156 FILENAME: the file this func was run on
157 MSG: a string containing the failure message
161 HAS-NO-EXAMPLES runs all the things against a file and returns
162 as soon as the first func error is found."
165 (defun values-result ()
166 "VALUES-RESULT => RESULT1, RESULT2, RESULT3
168 RESULT1: SUCCESS-RESULT | FAILURE-RESULT
169 SUCCESS-RESULT: (:success FILENAME)
170 FAILURE-RESULT: (:failure FILENAME MSG)
172 ARGUMENTS AND VALUES:
174 RESULT2: second result
175 RESULT3: third result
176 FILENAME: the file this func was run on
177 MSG: a string containing the failure message
181 VALUES-RESULT runs all the things against a file and returns
182 as soon as the first func error is found."
185 (defun has-optional (path &optional x)
186 "HAS-OPTIONAL PATH &optional X => RESULT
188 RESULT: SUCCESS-RESULT | FAILURE-RESULT
189 SUCCESS-RESULT: (:success FILENAME)
190 FAILURE-RESULT: (:failure FILENAME MSG)
192 ARGUMENTS AND VALUES:
195 X: a random value related to PATH
196 FILENAME: the file this func was run on
197 MSG: a string containing the failure message
201 HAS-OPTIONAL runs all the things against a file and returns
202 as soon as the first func error is found.
204 This second section uses PATH and X as something we should talk about, but
205 doesn't use all the arguments (let's include PATH here for fun)"
208 (defun has-keywords (path &key x)
209 "HAS-KEYWORDS PATH &key X => RESULT
211 RESULT: SUCCESS-RESULT | FAILURE-RESULT
212 SUCCESS-RESULT: (:success FILENAME)
213 FAILURE-RESULT: (:failure FILENAME MSG)
215 ARGUMENTS AND VALUES:
218 X: a random value related to PATH
219 FILENAME: the file this func was run on
220 MSG: a string containing the failure message
224 HAS-KEYWORDS runs all the things against a file and returns
225 as soon as the first func error is found.
227 This second section uses PATH and X as something we should talk about, but
228 doesn't use all the arguments (let's include PATH here for fun)"
231 (defun has-rest (path &rest x)
232 "HAS-REST PATH &rest X => RESULT
234 RESULT: SUCCESS-RESULT | FAILURE-RESULT
235 SUCCESS-RESULT: (:success FILENAME)
236 FAILURE-RESULT: (:failure FILENAME MSG)
238 ARGUMENTS AND VALUES:
241 X: a random value related to PATH
242 FILENAME: the file this func was run on
243 MSG: a string containing the failure message
247 HAS-REST runs all the things against a file and returns
248 as soon as the first func error is found.
250 This second section uses PATH and X as something we should talk about, but
251 doesn't use all the arguments (let's include PATH here for fun)"