changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/std/pkg.lisp

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