Coverage report: /development/source/library/org/datagraph/spocq-shard/src/algebra/operators/null.lisp
| Kind | Covered | All | % |
| expression | 28 | 79 | 35.4 |
| branch | 0 | 0 | nil |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;;; -*- Mode: lisp; Syntax: ansi-common-lisp; Base: 10; Package: org.datagraph.spocq.implementation; -*-
3
(in-package :org.datagraph.spocq.implementation)
5
(:documentation "This file defines the NULL operator for the 'org.datagraph.spocq' RDF SPARQL engine."
8
"Copyright 2012 [james anderson](mailto:james.anderson@setf.de) All Rights Reserved."))
11
(defmacro spocq.a:|null| (&optional dimensions)
12
"( ( variable*? ) solutionField )
13
A NULL form produces an empty solution field of the given dimensionality"
15
`(null-generator ',dimensions))
19
(defun null-generator (&optional dimensions)
20
"Construct a solution source and terminate it immediately, in-line return it
21
in a generator wrapper."
23
(typecase *transaction*
25
(matrix-null nil dimensions))
27
(let ((result-channel (make-null-channel :dimensions dimensions)))
28
(process-null result-channel dimensions)
29
(make-null-generator :operator 'spocq.a:|null|
30
:dimensions dimensions
32
:channel result-channel
36
(defun process-null (destination dimensions)
37
(assert-argument-types process-null
38
(destination (or channel function)))
39
(incf-stat *algebra-operations*)
40
(trace-algebra process-null dimensions)
42
(complete-field destination))
45
(defun singleton-generator (dimensions)
46
"Construct a solution source, emit one solution with no values and terminate it immediately,
47
in-line return it in a generator wrapper."
49
(typecase *transaction*
51
(matrix-singleton nil dimensions))
53
(let ((result-channel (make-channel :dimensions dimensions)))
54
(process-singleton result-channel dimensions)
55
(make-solution-generator :operator 'spocq.a:|unbound|
56
:dimensions dimensions
58
:channel result-channel
62
(defun process-singleton (destination dimensions)
63
(assert-argument-types process-singleton
64
(destination (or channel function)))
65
(incf-stat *algebra-operations*)
66
(trace-algebra process-singleton dimensions)
67
(let ((page (new-field-page destination 1 (length dimensions))))
68
(incf-stat *solutions-constructed* 1)
69
(setf page (adjust-page page (list 1 (length dimensions))))
70
(put-field-page destination page)
72
(complete-field destination)))