changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/std/pkg.lisp

changeset 336: 0af47621fa8b
parent: 267342781234
child: 254cca648492
author: Richard Westhaver <ellis@rwest.io>
date: Sun, 12 May 2024 22:13:22 -0400
permissions: -rw-r--r--
description: printing, bugfixes
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/readtable
187  (:use :cl)
188  (:import-from :std/named-readtables :defreadtable)
189  (:import-from :std/sym :symb)
190  (:import-from :std/list :defmacro!) ;; kludge
191  (:export
192  ;; readtable
193  :|#"-reader|
194  :|#`-reader|
195  :|#f-reader|
196  :|#$-reader|
197  :segment-reader
198  :match-mode-ppcre-lambda-form
199  :subst-mode-ppcre-lambda-form
200  :|#~-reader|
201  :_))
202 
203 (defpkg :std/macs
204  (:use :cl)
205  (:import-from :std/sym :symb :mkstr :make-gensym-list :once-only :with-gensyms)
206  (:import-from :std/named-readtables :in-readtable :parse-body)
207  (:import-from :std/list :flatten :defmacro!)
208  (:export
209  :named-lambda
210  :g!-symbol-p
211  :defmacro/g!
212  :o!-symbol-p
213  :o!-symbol-to-g!-symbol
214  :defmacro!
215  :defun!
216  :dlambda
217  :until
218  :fact
219  :choose
220  :make-tlist
221  :tlist-left
222  :tlist-right
223  :tlist-empty-p
224  :tlist-add-left
225  :tlist-add-right
226  :tlist-rem-left
227  :tlist-update
228  :build-batcher-sn
229  :sortf
230  :dollar-symbol-p
231  :if-match
232  :when-match
233  :once-only
234  :destructuring-case
235  :destructuring-ccase
236  :destructuring-ecase
237  :when-let
238  :when-let*
239  :if-let
240  :if-let*
241  :if*
242  :define-constant
243  :def!
244  :eval-always
245  ;; ana
246  :awhen
247  :acond
248  :alambda
249  :nlet-tail
250  :alet%
251  :alet
252  :acond2
253  :it
254  :aif
255  :this
256  :self
257  ;; pan
258  :pandoriclet
259  :pandoriclet-get
260  :pandoriclet-set
261  :get-pandoric
262  :with-pandoric
263  :pandoric-hotpatch
264  :pandoric-recode
265  :plambda
266  :pandoric-eval))
267 
268 (defpkg :std/fu
269  (:use :cl)
270  (:import-from :std/macs :make-gensym-list)
271  (:export
272  :ensure-function
273  :ensure-functionf
274  :disjoin
275  :conjoin
276  :compose
277  :multiple-value-compose
278  :curry
279  :rcurry))
280 
281 (defpkg :std/bit
282  (:use :cl)
283  (:import-from :std/type :octet :octet-vector)
284  (:export
285  :make-bits
286  :sign-bit
287  :different-signs-p
288  :mortify-bits
289  :int-list-bits
290  :aref-bit
291  :make-bit-vector
292  :logbit
293  :bitfield
294  :bitfield-slot-name
295  :bitfield-slot-start
296  :bitfield-slot-end
297  :bitfield-slot-size
298  :bitfield-slot-reader
299  :bitfield-slot-initform
300  :bitfield-slot-pack
301  :bitfield-slot-unpack
302  :parse-atomic-bitfield-slot-specifier
303  :parse-compound-bitfield-slot-specifier
304  :bitfield-slot
305  :bitfield-boolean-slot
306  :bitfield-integer-slot
307  :bitfield-member-slot
308  :define-bitfield
309  :hex-string-to-octet-vector
310  :octet-vector-to-hex-string
311  :octets-to-integer
312  :integer-to-octets
313  :hexchar-to-int))
314 
315 (defpkg :std/fmt
316  (:use :cl)
317  (:import-from :std/list :group :ensure-cons)
318  (:shadowing-import-from :uiop :println)
319  (:export :printer-status :fmt-row :format-sxhash :iprintln :fmt-tree :println))
320 
321 (defpkg :std/path
322  (:use :cl)
323  (:export
324  :wild-pathname
325  :non-wild-pathname
326  :absolute-pathname
327  :relative-pathname
328  :directory-pathname
329  :absolute-directory-pathname))
330 
331 (defpkg :std/os
332  (:use :cl)
333  (:export
334  :list-all-users
335  :list-all-groups))
336 
337 (defpkg :std/file
338  (:use :cl)
339  (:import-from :std/macs :define-constant :once-only :eval-always)
340  (:import-from :std/stream :copy-stream)
341  (:import-from :std/type :octet :octet-vector :array-index :array-length :+default-element-type+)
342  (:export
343  :tmpfile
344  :file-pathname
345  :with-open-files
346  :write-stream-into-file
347  :write-file-into-stream
348  :file=
349  :file-size
350  :file-size-in-octets
351  :+pathsep+
352  :octet-vector=
353  :file-date
354  :file-timestamp
355  :directory-path-p
356  :hidden-path-p
357  :directory-path
358  :find-files
359  :count-file-lines))
360 
361 (defpkg :std/string
362  (:use :cl)
363  (:export
364  :*omit-nulls*
365  :*whitespaces*
366  :string-designator
367  :ssplit
368  :trim
369  :collapse-whitespaces
370  :make-template-parser
371  :string-case))
372 
373 (defpkg :std/seq
374  (:use :cl)
375  (:import-from :sb-int :collect)
376  (:import-from :std/array :signed-array-length)
377  (:export :take))
378 
379 (defpkg :std/sys
380  (:use :cl)
381  (:shadowing-import-from :sb-kernel :get-lisp-obj-address :with-pinned-objects :unbound-marker-p :generation-of)
382  (:shadowing-import-from :sb-vm :list-allocated-objects)
383  (:export
384  :current-lisp-implementation
385  :save-lisp-tree-shake-and-die
386  :save-lisp-and-live))
387 
388 (defpkg :std
389  (:use :cl :sb-unicode :cl-ppcre :sb-mop :sb-c :sb-thread :sb-alien :sb-gray :sb-concurrency)
390  (:use-reexport :std/named-readtables :std/defpkg :std/err :std/sym :std/list :std/type :std/num
391  :std/stream :std/fu :std/array :std/hash-table :std/alien :std/mop :std/thread
392  :std/macs :std/bit :std/fmt :std/path :std/os :std/file :std/string :std/seq :std/sys :std/readtable))