changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/std/pkg.lisp

changeset 357: 7c1383c08493
parent: 09f056e9a789
child: 0e00dec3de03
author: Richard Westhaver <ellis@rwest.io>
date: Tue, 21 May 2024 22:20:29 -0400
permissions: -rw-r--r--
description: port xsubseq, proc-parse. work on http and clap
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 
267 (defpkg :std/readtable
268  (:use :cl)
269  (:import-from :std/named-readtables :defreadtable)
270  (:import-from :std/fu :curry :rcurry :compose)
271  (:import-from :std/sym :symb)
272  (:import-from :std/list :defmacro!) ;; kludge
273  (:export
274  ;; readtable
275  :|#"-reader|
276  :|#`-reader|
277  :|#f-reader|
278  :|#$-reader|
279  :segment-reader
280  :match-mode-ppcre-lambda-form
281  :subst-mode-ppcre-lambda-form
282  :|#~-reader|
283  :_))
284 
285 (defpkg :std/bit
286  (:use :cl)
287  (:import-from :std/type :octet :octet-vector)
288  (:export
289  :make-bits
290  :sign-bit
291  :different-signs-p
292  :mortify-bits
293  :int-list-bits
294  :aref-bit
295  :make-bit-vector
296  :logbit
297  :bitfield
298  :bitfield-slot-name
299  :bitfield-slot-start
300  :bitfield-slot-end
301  :bitfield-slot-size
302  :bitfield-slot-reader
303  :bitfield-slot-initform
304  :bitfield-slot-pack
305  :bitfield-slot-unpack
306  :parse-atomic-bitfield-slot-specifier
307  :parse-compound-bitfield-slot-specifier
308  :bitfield-slot
309  :bitfield-boolean-slot
310  :bitfield-integer-slot
311  :bitfield-member-slot
312  :define-bitfield
313  :hex-string-to-octet-vector
314  :octet-vector-to-hex-string
315  :octets-to-integer
316  :integer-to-octets
317  :hexchar-to-int))
318 
319 (defpkg :std/fmt
320  (:use :cl)
321  (:import-from :std/list :group :ensure-cons)
322  (:shadowing-import-from :uiop :println)
323  (:export :printer-status :fmt-row :format-sxhash :iprintln :fmt-tree :println))
324 
325 (defpkg :std/path
326  (:use :cl)
327  (:export
328  :wild-pathname
329  :non-wild-pathname
330  :absolute-pathname
331  :relative-pathname
332  :directory-pathname
333  :absolute-directory-pathname))
334 
335 (defpkg :std/os
336  (:use :cl)
337  (:export
338  :list-all-users
339  :list-all-groups))
340 
341 (defpkg :std/file
342  (:use :cl)
343  (:import-from :std/macs :define-constant :once-only :eval-always)
344  (:import-from :std/stream :copy-stream)
345  (:import-from :std/type :octet :octet-vector :array-index :array-length :+default-element-type+)
346  (:export
347  :tmpfile
348  :file-pathname
349  :with-open-files
350  :write-stream-into-file
351  :write-file-into-stream
352  :file=
353  :file-size
354  :file-size-in-octets
355  :+pathsep+
356  :octet-vector=
357  :file-date
358  :file-timestamp
359  :directory-path-p
360  :*hidden-paths*
361  :hidden-path-p
362  :directory-path
363  :find-files
364  :count-file-lines))
365 
366 (defpkg :std/string
367  (:use :cl)
368  (:export
369  :*omit-nulls*
370  :*whitespaces*
371  :string-designator
372  :ssplit
373  :trim
374  :collapse-whitespaces
375  :make-template-parser
376  :string-case))
377 
378 (defpkg :std/seq
379  (:use :cl)
380  (:import-from :sb-int :collect)
381  (:import-from :std/array :signed-array-length)
382  (:export :take))
383 
384 (defpkg :std/sys
385  (:use :cl)
386  (:shadowing-import-from :sb-kernel :get-lisp-obj-address :with-pinned-objects :unbound-marker-p :generation-of)
387  (:shadowing-import-from :sb-vm :list-allocated-objects)
388  (:export
389  :current-lisp-implementation
390  :save-lisp-tree-shake-and-die
391  :save-lisp-and-live))
392 
393 (defpkg :std
394  (:use :cl :sb-unicode :cl-ppcre :sb-mop :sb-c :sb-thread :sb-alien :sb-gray :sb-concurrency)
395  (:use-reexport :std/named-readtables :std/defpkg :std/err :std/sym :std/list :std/type :std/num
396  :std/stream :std/fu :std/array :std/hash-table :std/alien :std/mop :std/thread
397  :std/macs :std/bit :std/fmt :std/path :std/os :std/file :std/string :std/seq :std/sys :std/readtable))