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
10 #:func-that-does-stuff #:noargs #:result-list #:has-no-examples
11 #:values-result #:has-optional #:has-keywords #:has-rest))
13 (in-package #:success1)
15 (defvar *special-variable* nil
28 It is special, and a boolean.
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.
35 (let ((*special-variable* t)) (go)) => 'let-it-go")
37 (define-condition test-condition nil nil
39 "Simple documentation.
41 For a simple condition."))
43 (defun func-that-does-stuff (path x)
44 "FUNC-THAT-DOES-STUFF PATH X => RESULT
46 RESULT: SUCCESS-RESULT | FAILURE-RESULT
47 SUCCESS-RESULT: (:success FILENAME)
48 FAILURE-RESULT: (:failure FILENAME MSG)
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
59 FUNC-THAT-DOES-STUFF runs all the things against a file and returns
60 as soon as the first func error is found.
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)
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)"
72 "RESULT-LIST => RESULT
74 RESULT: FAILURE-RESULT*
75 FAILURE-RESULT: (:failure FILENAME MSG)
79 FILENAME: the file this func was run on
80 MSG: a string containing the failure message
84 RESULT-LIST runs all the things against a file and returns
85 as soon as the first func error is found."
91 RESULT: SUCCESS-RESULT | FAILURE-RESULT
92 SUCCESS-RESULT: (:success FILENAME)
93 FAILURE-RESULT: (:failure FILENAME MSG)
97 FILENAME: the file this func was run on
98 MSG: a string containing the failure message
102 NOARGS runs all the things against a file and returns
103 as soon as the first func error is found.
107 (func-that-does-stuff) => (:success \"path/to/file.lisp\")
108 (func-that-does-stuff) => (:failure \"path/to/error.lisp\" \"Error msg\" 20 0)"
111 (defun has-no-examples ()
112 "HAS-NO-EXAMPLES => RESULT
114 RESULT: SUCCESS-RESULT | FAILURE-RESULT
115 SUCCESS-RESULT: (:success FILENAME)
116 FAILURE-RESULT: (:failure FILENAME MSG)
118 ARGUMENTS AND VALUES:
120 FILENAME: the file this func was run on
121 MSG: a string containing the failure message
125 HAS-NO-EXAMPLES runs all the things against a file and returns
126 as soon as the first func error is found."
129 (defun values-result ()
130 "VALUES-RESULT => RESULT1, RESULT2, RESULT3
132 RESULT1: SUCCESS-RESULT | FAILURE-RESULT
133 SUCCESS-RESULT: (:success FILENAME)
134 FAILURE-RESULT: (:failure FILENAME MSG)
136 ARGUMENTS AND VALUES:
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
145 VALUES-RESULT runs all the things against a file and returns
146 as soon as the first func error is found."
149 (defun has-optional (path &optional x)
150 "HAS-OPTIONAL PATH &optional X => RESULT
152 RESULT: SUCCESS-RESULT | FAILURE-RESULT
153 SUCCESS-RESULT: (:success FILENAME)
154 FAILURE-RESULT: (:failure FILENAME MSG)
156 ARGUMENTS AND VALUES:
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
165 HAS-OPTIONAL runs all the things against a file and returns
166 as soon as the first func error is found.
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)"
172 (defun has-keywords (path &key x)
173 "HAS-KEYWORDS PATH &key X => RESULT
175 RESULT: SUCCESS-RESULT | FAILURE-RESULT
176 SUCCESS-RESULT: (:success FILENAME)
177 FAILURE-RESULT: (:failure FILENAME MSG)
179 ARGUMENTS AND VALUES:
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
188 HAS-KEYWORDS runs all the things against a file and returns
189 as soon as the first func error is found.
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)"
195 (defun has-rest (path &rest x)
196 "HAS-REST PATH &rest X => RESULT
198 RESULT: SUCCESS-RESULT | FAILURE-RESULT
199 SUCCESS-RESULT: (:success FILENAME)
200 FAILURE-RESULT: (:failure FILENAME MSG)
202 ARGUMENTS AND VALUES:
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
211 HAS-REST runs all the things against a file and returns
212 as soon as the first func error is found.
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)"