changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/std/pkg.lisp

changeset 359: 0e00dec3de03
parent: 7c1383c08493
child: de40bd522c84
author: Richard Westhaver <ellis@rwest.io>
date: Wed, 22 May 2024 22:16:26 -0400
permissions: -rw-r--r--
description: macs/control macros, seq functions, ported cl-cookie, added uri/domain.lisp, fully ported http! next we should remove dependence on cl+ssl
1 (pushnew :std *features*)
2 (pushnew "STD" *modules* :test 'equal)
3 
4 (defpackage :std-user
5  (:use :cl :std/named-readtables :std/defpkg)
6  (:shadowing-import-from :std/defpkg :defpkg)
7  (:export :defpkg :in-readtable))
8 
9 (in-package :std-user)
10 
11 (defpkg :std/err
12  (:use :cl)
13  (:export ;; err
14  :std-error :std-error-message
15  :define-error-reporter
16  :deferror
17  :nyi!
18  :required-argument
19  :ignore-some-conditions
20  :simple-style-warning
21  :simple-reader-error
22  :simple-parse-error
23  :simple-program-error
24  :circular-dependency
25  :circular-dependency-items
26  :unknown-argument
27  :unknown-argument-name
28  :unknown-argument-kind
29  :unknown-argument-p
30  :missing-argument
31  :missing-argument-command
32  :missing-argument-p
33  :invalid-argument
34  :invalid-argument-item
35  :invalid-argument-reason
36  :invalid-argument-p
37  :unwind-protect-case))
38 
39 (defpkg :std/sym
40  (:use :cl)
41  (:shadowing-import-from :sb-int
42  :with-unique-names :symbolicate :package-symbolicate :keywordicate :gensymify*
43  :gensymify)
44  (:export
45  :ensure-symbol
46  :format-symbol
47  :make-keyword
48  :make-slot-name
49  :make-gensym
50  :make-gensym-list
51  :with-gensyms
52  :with-unique-names
53  :symbolicate
54  :keywordicate
55  :gensymify
56  :gensymify*))
57 
58 (defpkg :std/list
59  (:use :cl)
60  (:shadowing-import-from :sb-int
61  :ensure-list :recons :memq :assq
62  :ensure-list :proper-list-of-length-p :proper-list-p :singleton-p)
63  (:import-from :std/sym :symb)
64  (:import-from :std/named-readtables :parse-body)
65  (:export
66  :ensure-car
67  :ensure-cons
68  :appendf
69  :nconcf
70  :unionf
71  :nunionf
72  :reversef
73  :nreversef
74  :deletef
75  :flatten
76  :group
77  :let-binding-transform
78  :ensure-list :recons :memq :assq
79  :circular-list :circular-list-p :circular-tree-p :merge!
80  :sort!))
81 
82 (defpkg :std/type
83  (:use :cl)
84  (:import-from :std/sym :format-symbol :with-gensyms)
85  (:import-from :std/list :ensure-car)
86  (:export :+default-element-type+
87  :array-index :array-length
88  :negative-integer :non-negative-integer
89  :positive-integer :octet
90  :octet-vector))
91 
92 (defpkg :std/num
93  (:use :cl)
94  (:export
95  ;; num/parse
96  :parse-number
97  :parse-real-number
98  :parse-positive-real-number
99  :invalid-number
100  :invalid-number-value
101  :invalid-number-reason
102  ;; num/float
103  :make-float-converters
104  :encode-float32
105  :decode-float32
106  :encode-float64
107  :decode-float64))
108 
109 (defpkg :std/stream
110  (:use :cl)
111  (:import-from :std/type :non-negative-integer :positive-integer)
112  (:export
113  ;; stream
114  :copy-stream
115  :wrapped-stream
116  :wrapped-character-input-stream
117  :wrapped-character-output-stream
118  :counting-character-input-stream
119  :prefixed-character-output-stream
120  :stream-of :char-count-of :line-count-of :col-count-of
121  :prev-col-count-of :col-index-of :write-prefix
122  :prefix-of))
123 
124 (defpkg :std/array
125  (:use :cl)
126  (:export :copy-array :signed-array-length))
127 
128 (defpkg :std/hash-table
129  (:use :cl)
130  (:nicknames :std/ht)
131  (:export :hash-table-alist
132  :maphash-keys :hash-table-keys
133  :maphash-values :hash-table-values))
134 
135 (defpkg :std/alien
136  (:use :cl :sb-alien)
137  (:import-from :std/sym :symbolicate :with-gensyms)
138  (:export
139  :setfa
140  :copy-c-string
141  :clone-strings
142  :clone-octets-to-alien
143  :clone-octets-from-alien
144  :foreign-int-to-integer
145  :foreign-int-to-bool
146  :bool-to-foreign-int
147  :define-opaque
148  :shared-object-name
149  :define-alien-loader
150  :c-string-to-string-list
151  :list-all-shared-objects
152  :num-cpus
153  :*cpus*
154  :loff-t
155  :memset))
156 
157 (defpkg :std/mop
158  (:use :cl :sb-mop :sb-pcl)
159  (:import-from :std/sym :symb :make-keyword)
160  (:export :list-slot-values-using-class
161  :list-class-methods :list-class-slots :list-indirect-slot-methods))
162 
163 (defpkg :std/thread
164  (:use :cl :sb-thread :sb-concurrency)
165  (:import-from :std/list :flatten)
166  (:export
167  :print-thread-message-top-level :thread-support-p
168  :find-thread-by-id :thread-id-list
169  :make-threads :with-threads :finish-threads
170  :timed-join-thread :kill-thread :hang
171  :thread-count :dump-thread
172  :make-oracle :make-supervisor :oracle :run-task
173  :oracle-id
174  :push-job :push-task :push-worker :push-result
175  :run-job :run-stage
176  :pop-job :pop-task :pop-worker :pop-result
177  :make-task-pool
178  :start-task-pool :pause-task-pool :shutdown-task-pool
179  :push-stage :designate-oracle :make-task-pool
180  :task :job :task-pool :stage :task-pool-p
181  :job-tasks :make-job :job-p :task-object
182  :make-task :task-p :task :wait-for-threads
183  :task-pool-oracle :task-pool-jobs :task-pool-stages
184  :task-pool-workers :task-pool-results))
185 
186 (defpkg :std/fu
187  (:use :cl)
188  (:import-from :std/sym :make-gensym-list)
189  (:export
190  :ensure-function
191  :ensure-functionf
192  :disjoin
193  :conjoin
194  :compose
195  :multiple-value-compose
196  :curry
197  :rcurry))
198 
199 (defpkg :std/macs
200  (:use :cl)
201  (:import-from :std/sym :symb :mkstr :make-gensym-list :once-only :with-gensyms)
202  (:import-from :std/fu :compose)
203  (:import-from :std/named-readtables :in-readtable :parse-body)
204  (:import-from :std/list :flatten :defmacro!)
205  (:export
206  :named-lambda
207  :g!-symbol-p
208  :defmacro/g!
209  :o!-symbol-p
210  :o!-symbol-to-g!-symbol
211  :defmacro!
212  :defun!
213  :dlambda
214  :until
215  :fact
216  :choose
217  :make-tlist
218  :tlist-left
219  :tlist-right
220  :tlist-empty-p
221  :tlist-add-left
222  :tlist-add-right
223  :tlist-rem-left
224  :tlist-update
225  :build-batcher-sn
226  :sortf
227  :dollar-symbol-p
228  :if-match
229  :when-match
230  :once-only
231  :destructuring-case
232  :destructuring-ccase
233  :destructuring-ecase
234  :when-let
235  :when-let*
236  :if-let
237  :if-let*
238  :if*
239  :define-constant
240  :def!
241  :eval-always
242  ;; ana
243  :awhen
244  :acond
245  :alambda
246  :nlet-tail
247  :alet%
248  :alet
249  :acond2
250  :it
251  :aif
252  :this
253  :self
254  ;; pan
255  :pandoriclet
256  :pandoriclet-get
257  :pandoriclet-set
258  :get-pandoric
259  :with-pandoric
260  :pandoric-hotpatch
261  :pandoric-recode
262  :plambda
263  :pandoric-eval
264  :with-collectors
265  :collecting
266  :xor))
267 
268 (defpkg :std/readtable
269  (:use :cl)
270  (:import-from :std/named-readtables :defreadtable)
271  (:import-from :std/fu :curry :rcurry :compose)
272  (:import-from :std/sym :symb)
273  (:import-from :std/list :defmacro!) ;; kludge
274  (:export
275  ;; readtable
276  :|#"-reader|
277  :|#`-reader|
278  :|#f-reader|
279  :|#$-reader|
280  :segment-reader
281  :match-mode-ppcre-lambda-form
282  :subst-mode-ppcre-lambda-form
283  :|#~-reader|
284  :_))
285 
286 (defpkg :std/bit
287  (:use :cl)
288  (:import-from :std/type :octet :octet-vector)
289  (:export
290  :make-bits
291  :sign-bit
292  :different-signs-p
293  :mortify-bits
294  :int-list-bits
295  :aref-bit
296  :make-bit-vector
297  :logbit
298  :bitfield
299  :bitfield-slot-name
300  :bitfield-slot-start
301  :bitfield-slot-end
302  :bitfield-slot-size
303  :bitfield-slot-reader
304  :bitfield-slot-initform
305  :bitfield-slot-pack
306  :bitfield-slot-unpack
307  :parse-atomic-bitfield-slot-specifier
308  :parse-compound-bitfield-slot-specifier
309  :bitfield-slot
310  :bitfield-boolean-slot
311  :bitfield-integer-slot
312  :bitfield-member-slot
313  :define-bitfield
314  :hex-string-to-octet-vector
315  :octet-vector-to-hex-string
316  :octets-to-integer
317  :integer-to-octets
318  :hexchar-to-int))
319 
320 (defpkg :std/fmt
321  (:use :cl)
322  (:import-from :std/list :group :ensure-cons)
323  (:shadowing-import-from :uiop :println)
324  (:export :printer-status :fmt-row :format-sxhash :iprintln :fmt-tree :println))
325 
326 (defpkg :std/path
327  (:use :cl)
328  (:export
329  :wild-pathname
330  :non-wild-pathname
331  :absolute-pathname
332  :relative-pathname
333  :directory-pathname
334  :absolute-directory-pathname))
335 
336 (defpkg :std/os
337  (:use :cl)
338  (:export
339  :list-all-users
340  :list-all-groups))
341 
342 (defpkg :std/file
343  (:use :cl)
344  (:import-from :std/macs :define-constant :once-only :eval-always)
345  (:import-from :std/stream :copy-stream)
346  (:import-from :std/type :octet :octet-vector :array-index :array-length :+default-element-type+)
347  (:export
348  :tmpfile
349  :file-pathname
350  :with-open-files
351  :write-stream-into-file
352  :write-file-into-stream
353  :file=
354  :file-size
355  :file-size-in-octets
356  :+pathsep+
357  :octet-vector=
358  :file-date
359  :file-timestamp
360  :directory-path-p
361  :*hidden-paths*
362  :hidden-path-p
363  :directory-path
364  :find-files
365  :count-file-lines))
366 
367 (defpkg :std/string
368  (:use :cl)
369  (:export
370  :*omit-nulls*
371  :*whitespaces*
372  :string-designator
373  :ssplit
374  :trim
375  :collapse-whitespaces
376  :make-template-parser
377  :string-case))
378 
379 (defpkg :std/seq
380  (:use :cl)
381  (:import-from :sb-int :collect)
382  (:import-from :std/array :signed-array-length)
383  (:export :take :starts-with-subseq :ends-with-subseq
384  :split-sequence :split-sequence-if :split-sequence-if-not))
385 
386 (defpkg :std/sys
387  (:use :cl)
388  (:shadowing-import-from :sb-kernel :get-lisp-obj-address :with-pinned-objects :unbound-marker-p :generation-of)
389  (:shadowing-import-from :sb-vm :list-allocated-objects)
390  (:export
391  :current-lisp-implementation
392  :save-lisp-tree-shake-and-die
393  :save-lisp-and-live))
394 
395 (defpkg :std
396  (:use :cl :sb-unicode :cl-ppcre :sb-mop :sb-c :sb-thread :sb-alien :sb-gray :sb-concurrency)
397  (:use-reexport :std/named-readtables :std/defpkg :std/err :std/sym :std/list :std/type :std/num
398  :std/stream :std/fu :std/array :std/hash-table :std/alien :std/mop :std/thread
399  :std/macs :std/bit :std/fmt :std/path :std/os :std/file :std/string :std/seq :std/sys :std/readtable))