changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/obj/pkg.lisp

changeset 554: 7845348eced6
parent: ec607b5f616f
child: 9e7d4393eac6
author: Richard Westhaver <ellis@rwest.io>
date: Thu, 18 Jul 2024 22:09:56 -0400
permissions: -rw-r--r--
description: srv work
1 ;;; obj/pkg.lisp --- Object System
2 
3 ;;
4 
5 ;;; Code:
6 (defpackage :obj/meta
7  (:nicknames :meta)
8  (:use :cl :std)
9  (:export
10  :class-equalp
11  :*standard-metaobjects*))
12 
13 (defpackage :obj/list
14  (:nicknames :list)
15  (:use :cl :std)
16  (:import-from :sb-lockless
17  :make-ordered-list :lfl-insert
18  :lfl-delete :lfl-find
19  :lfl-insert*/t :lfl-delete*/t :lfl-find*/t
20  :do-lockfree-list :lfl-keys :make-marked-ref)
21  (:export :clist))
22 
23 (defpackage :obj/hash
24  (:nicknames :hash)
25  (:use :cl :std)
26  (:import-from :sb-lockless
27  :make-so-map/fixnum :+hash-nbits+
28  :get-next :node-hash
29  :so-head :so-bins
30  :so-key :so-data
31  :so-count :so-key-node-p
32  :so-insert :so-delete
33  :so-find :so-find/string
34  :so-maplist :make-so-map/string
35  :make-so-set/string :make-so-map/addr :make-marked-ref)
36  (:export
37  :*global-hasher*
38  :*global-hash*
39  :djb
40  :hash-object
41  :hash-object-address
42  :dumb-string-hash
43  ;; castable
44  :castable
45  :make-castable
46  :castable-p
47  :rehash
48  :castable-size
49  :castable-count
50  :castable-test
51  :castable-hasher
52  :getchash
53  :remchash
54  :try-remchash
55  :put-if-absent
56  :put-if-equal
57  :put-if-present
58  :clrchash
59  :mapchash))
60 
61 (defpackage :obj/id
62  (:nicknames :id)
63  (:use :cl :std :obj/hash)
64  (:export
65  :id :reset-id :update-id :make-id
66  :id-factory))
67 
68 (defpackage :obj/equiv
69  (:use :cl :std)
70  (:export :equiv :eqv :nequiv :neqv :equivalence))
71 
72 (defpackage :obj/uri
73  (:nicknames :uri)
74  (:use :cl :std)
75  (:export
76  :uri ; class
77  :uri-p
78  :iri ; subclass of uri
79  :iri-p
80  :copy-uri
81 
82  :uri-parse-error
83  :uri-parse-error-string
84 
85  :uri-scheme
86  :uri-userinfo
87  :uri-port
88  :uri-path
89  :uri-query
90  :uri-fragment
91  :uri-ipv6
92  :uri-zone-id
93  :uri-plist
94  :uri-authority ; pseudo-slot accessor
95  :uri-host
96  :urn ; class
97  :urn-nid
98  :urn-nss
99  :urn-q-component ; RFC 8141
100  :urn-f-component ; RFC 8141
101  :urn-r-component ; RFC 8141
102  :*strict-parse*
103  :parse-uri
104  :merge-uris
105  :enough-uri
106  :uri-parsed-path
107  :render-uri
108  :string-to-uri
109  :uri-to-string
110  :string-to-iri
111  :iri-to-string
112  :parse-uri-string-rfc3986
113  :parse-iri-string-rfc3987
114  :make-uri-space ; interning...
115  :uri-space
116  :uri=
117  :intern-uri
118  :unintern-uri
119  :do-all-uris
120  :uri-to-pathname
121  :pathname-to-uri
122  ;; domains
123  :parse-domain
124  :ipv4-addr-p
125  :ipv6-addr-p
126  :ip-addr-p
127  :ip-addr=
128  :uri-tld
129  :uri-domain))
130 
131 (pkg:defpkg :obj/url
132  (:nicknames :url)
133  (:use :cl :std :obj/uri)
134  (:shadowing-import-from :quri :url-encode :url-decode :url-encode-params :url-decode-params)
135  (:export :url-encode :url-decode :url-encode-params :url-decode-params))
136 
137 (defpackage :obj/seq
138  (:nicknames :seq)
139  (:use :cl :std)
140  (:export :iterator :ring))
141 
142 (defpackage :obj/tree
143  (:nicknames :tree)
144  (:use :cl :std :obj/id :obj/seq)
145  (:export :keytype :tree-node :binary-node :unary-node :ternary-node :avl-node
146  :make-node :make-binary-node :make-unary-node :make-ternary-node :make-avl-node))
147 
148 (defpackage :obj/graph
149  (:nicknames :graph)
150  (:use :cl :std :obj/id :obj/seq)
151  (:export
152  :vertex :edge :graph :make-edge :make-graph
153  :nodes :edges :add-node :add-edge
154  :weighted-edge :directed-edge :undirected-edge :directed-graph
155  :edge-value :edge-weight :node-edges))
156 
157 (defpackage :obj/color
158  (:nicknames :color)
159  (:use :cl :std)
160  (:export
161  #:rgb #:rgb-red #:rgb-green #:rgb-blue #:gray #:&rgb
162  #:hsv #:hsv-hue #:hsv-saturation #:hsv-value #:&hsv
163  #:rgb-to-hsv #:hsv-to-rgb #:hex-to-rgb #:as-hsv #:as-rgb
164  #:rgb-combination #:hsv-combination
165  #:parse-hex-rgb #:print-hex-rgb
166  :color-palette :parse-and-write-color-definitions))
167 
168 (defpackage :obj/time
169  (:nicknames :time)
170  (:use :cl :std)
171  (:export
172  :iso-time
173  :rfc-1123-date
174  :timestamp
175  :date
176  :time-of-day
177  :make-timestamp
178  :clone-timestamp
179  :day-of
180  :sec-of
181  :nsec-of
182  :timestamp<
183  :timestamp<=
184  :timestamp>
185  :timestamp>=
186  :timestamp=
187  :timestamp/=
188  :timestamp-maximum
189  :timestamp-minimum
190  :adjust-timestamp
191  :adjust-timestamp!
192  :timestamp-whole-year-difference
193  :days-in-month
194  :timestamp-
195  :timestamp+
196  :timestamp-difference
197  :timestamp-minimize-part
198  :timestamp-maximize-part
199  :with-decoded-timestamp
200  :decode-timestamp
201  :timestamp-century
202  :timestamp-day
203  :timestamp-day-of-week
204  :timestamp-decade
205  :timestamp-hour
206  :timestamp-microsecond
207  :timestamp-millennium
208  :timestamp-millisecond
209  :timestamp-minute
210  :timestamp-month
211  :timestamp-second
212  :timestamp-week
213  :timestamp-year
214  :parse-timestring
215  :invalid-timestring
216  :format-timestring
217  :format-rfc1123-timestring
218  :to-rfc1123-timestring
219  :format-rfc3339-timestring
220  :to-rfc3339-timestring
221  :encode-timestamp
222  :parse-rfc3339-timestring
223  :universal-to-timestamp
224  :timestamp-to-universal
225  :unix-to-timestamp
226  :timestamp-to-unix
227  :timestamp-subtimezone
228  :define-timezone
229  :*default-timezone*
230  :*clock*
231  :leap-second-adjusted
232  :clock-now
233  :clock-today
234  :find-timezone-by-location-name
235  :timezones-matching-subzone
236  :all-timezones-matching-subzone
237  :reread-timezone-repository
238  :now
239  :today
240  :format-date-simple
241  :enable-read-macros
242  :+utc-zone+
243  :+gmt-zone+
244  :+month-names+
245  :+short-month-names+
246  :+day-names+
247  :+short-day-names+
248  :+seconds-per-day+
249  :+seconds-per-hour+
250  :+seconds-per-minute+
251  :+minutes-per-day+
252  :+minutes-per-hour+
253  :+hours-per-day+
254  :+days-per-week+
255  :+months-per-year+
256  :+iso-8601-format+
257  :+iso-8601-date-format+
258  :+iso-8601-time-format+
259  :+rfc3339-format+
260  :+rfc3339-format/date-only+
261  :+asctime-format+
262  :+rfc-1123-format+
263  :+iso-week-date-format+
264  :astronomical-julian-date
265  :modified-julian-date
266  :astronomical-modified-julian-date
267  :zone-name
268  :encode-universal-time-with-tz
269  :decode-universal-time-with-tz))
270 
271 (defpackage :obj/uuid
272  (:nicknames :uuid)
273  (:use :cl :std :obj/id :obj/time)
274  (:export
275  :uuid :*ticks-per-count* :format-as-urn :make-null-uuid
276  :make-uuid-from-string :make-v1-uuid :make-v3-uuid :make-v4-uuid
277  :make-v5-uuid :uuid= :+namespace-dns+ :+namespace-oid+ :+namespace-x500+
278  :uuid-to-octet-vector :octet-vector-to-uuid))
279 
280 (defpackage :obj/music
281  (:nicknames :music)
282  (:use :cl :std)
283  (:export
284  :*bpm* :*key-signature* :*time-signature*
285  :*chord-table* :*key-table* :*tone-table*))
286 
287 (defpackage :obj/temperature
288  (:nicknames :temperature)
289  (:use :cl :std)
290  (:export :fahrenheit :celsius :kelvin :rankine))
291 
292 (defpackage :obj/direction
293  (:nicknames :direction)
294  (:use :cl :std)
295  (:export :up :down :left
296  :right :east :west :north
297  :north-east :north-west :south-east :south-west
298  :direction :angle))
299 
300 (defpackage :obj/shape
301  (:nicknames :shape)
302  (:use :cl :std)
303  (:export :circle :square :cube :sphere :triangle :pyramid))
304 
305 (defpackage :obj/cfg
306  (:nicknames :cfg)
307  (:use :cl :std)
308  (:export :cfg :make-cfg :find-cfg
309  :cfg-find :cfg-get :defcfg))
310 
311 (defpackage :obj/db
312  (:nicknames :db)
313  (:use :cl :std :id :seq :sb-mop :sb-pcl)
314  (:export
315  :load-db
316  :get-val
317  :set-val
318  :dbs
319  :get-db
320  :add-db
321  :make-db
322  :close-db
323  :destroy-db
324  :connect-db
325  :query-db
326  :db-get
327  :db
328  :database))
329 
330 (defpackage :obj/query
331  (:nicknames :query)
332  (:use :cl :std)
333  (:export :query
334  :data-source
335  :query-expression
336  :logical-expression
337  :column-expression
338  :literal-expression
339  :field
340  :fields
341  :row-count
342  :column-count
343  :record-batch
344  :schema
345  :derive-schema
346  :load-schema
347  :make-schema
348  :make-query
349  :field-vector
350  :*literal-value-types*
351  :literal-value-type
352  :literal-value-vector
353  :projection
354  :selection
355  :aggregate
356  :data-frame
357  :execution-context
358  :physical-expression
359  :physical-plan
360  :scan-exec
361  :scan-data
362  :execute-query
363  :aggregate-function
364  :aggregate-function-designator
365  :aggregate-expression
366  :binary-expression
367  :unary-expression
368  :alias-expression
369  :query-optimizer
370  :make-physical-plan
371  :make-physical-expression
372  :query-planner
373  :hash-aggregate-exec
374  :filter
375  :selection-exec
376  :projection-exec
377  :execute
378  :max-physical-expression
379  :aggregate-physical-expression
380  :accumulated
381  :accumulate
382  :accumulator
383  :math-physical-expression
384  :equiv-physical-expression
385  :binary-physical-expression
386  :literal-physical-expression
387  :column-physical-expression
388  :evaluate
389  :schema-metadata
390  :make-record-batch
391  :record-batch-p
392  :copy-record-batch
393  :record-batch-schema
394  :record-batch-fields
395  :make-field
396  :field-p
397  :copy-field
398  :field-name
399  :field-type
400  :column-size
401  :column-value
402  :column-type
403  :column-vector
404  :column-data))
405 
406 (defpackage :obj/secret
407  (:nicknames :secret)
408  (:use :cl :std)
409  (:export :secret-object :reveal-object :conceal-object
410  :ensure-revealed :ensure-concealed))
411 
412 (defpackage :obj/build
413  (:use :cl :std)
414  (:export :build :build-from))
415 
416 (uiop:define-package :obj
417  (:use-reexport :list :hash :color
418  :seq :tree :graph :id
419  :db :time :uri :url
420  :cfg :music :temperature :direction
421  :shape :secret :query))