domains/tests.lisp
in-package#:luv.tests
deftestidentity-vocabulary-offsets-are-stable-and-closed
let*
stone
list:stone
earth
list:earth
vocabulary
ok
ok
ok
ok
ok
null
ok
zerop
luv.domains:identity-vocabulary-revisionvocabulary
ok
ok
ok
ok
ok
deftestkeyword-vocabularies-close-dense-offsets-over-an-explicit-domain
let*
first
luv.domains:make-keyword-vocabulary-domain'
:grass:stone:crystal
second
luv.domains:make-keyword-vocabulary-domain'
:crystal:grass:stone
ok
ok
ok
eq:stone
ok
ok
null
ok
ok
deftestkeyword-vocabularies-are-immutable-and-unambiguous
let*
source
vector:dirt:sand
domain
members
setf
arefsource0
:claysetf
arefmembers0
:mudok
eq:dirt
ok
ok
defun make-identity-vocabulary-domain
(&key members limit)define-arithmetic-operator =
Test whether two compatible scalars are equal.
defgeneric domain-cardinality
(domain)Return the exact number of sites in finite DOMAIN. This deliberately says nothing about coordinate or offset representation. Those mappings belong to concrete domain protocols and are added only when a client needs to traverse them.
defun identity-vocabulary-offset
(domain member &optional (intern-p t))defun identity-vocabulary-member
(domain offset)defun make-keyword-vocabulary-domain
(members)Return an immutable keyword domain preserving MEMBERS' order exactly. Duplicate or non-keyword members are rejected. The resulting mapping is appropriate for dense runtime columns and for explicit persisted vocabulary tables; the keyword is semantic identity and its offset is only meaningful under this domain.
defun keyword-vocabulary-offset
(domain keyword &optional (error-p t))Return KEYWORD's dense offset under DOMAIN. When ERROR-P is false, return NIL for a keyword outside the domain.
defun keyword-vocabulary-keyword
(domain offset)defun keyword-vocabulary-members
(domain)