Comparing version 4.0.0 to 5.0.0
@@ -1,2 +0,1 @@ | ||
// Generated by CoffeeScript 2.5.1 | ||
(function() { | ||
@@ -816,2 +815,40 @@ 'use strict'; | ||
*/ | ||
//----------------------------------------------------------------------------------------------------------- | ||
this["dirty"] = function(T, done) { | ||
var DATOM_DEFAULT, DATOM_DIRTY, DATOM_NODIRTY, d; | ||
DATOM_DIRTY = new (require('../..')).Datom({ | ||
dirty: true | ||
}); | ||
DATOM_NODIRTY = new (require('../..')).Datom({ | ||
dirty: false | ||
}); | ||
DATOM_DEFAULT = new (require('../..')).Datom(); | ||
//......................................................................................................... | ||
d = DATOM_DEFAULT.new_datom('^foo', { | ||
x: 42, | ||
y: 108 | ||
}); | ||
T.eq(DATOM_DIRTY.lets(d, function(d) { | ||
return delete d.x; | ||
}), { | ||
$key: '^foo', | ||
y: 108, | ||
$dirty: true | ||
}); | ||
T.eq(DATOM_NODIRTY.lets(d, function(d) { | ||
return delete d.x; | ||
}), { | ||
$key: '^foo', | ||
y: 108 | ||
}); | ||
T.eq(DATOM_DEFAULT.lets(d, function(d) { | ||
return delete d.x; | ||
}), { | ||
$key: '^foo', | ||
y: 108 | ||
}); | ||
done(); | ||
return null; | ||
}; | ||
//########################################################################################################### | ||
@@ -821,7 +858,8 @@ if (require.main === module) { | ||
// test @ | ||
return test(this["wrap_datom"]); | ||
return test(this["dirty"]); | ||
})(); | ||
} | ||
// test @[ "new_datom complains when value has `$key`" ] | ||
// test @[ "wrap_datom" ] | ||
// test @[ "new_datom complains when value has `$key`" ] | ||
// test @[ "selector keypatterns" ] | ||
@@ -833,3 +871,1 @@ // test @[ "select 2" ] | ||
}).call(this); | ||
//# sourceMappingURL=select.test.js.map |
@@ -131,3 +131,3 @@ // Generated by CoffeeScript 2.5.1 | ||
freeze: true, | ||
dirty: true | ||
dirty: false | ||
}, | ||
@@ -134,0 +134,0 @@ vnr_settings: { |
{ | ||
"name": "datom", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"description": "standardized immutable objects in the spirit of datomic, especially suited for use in data pipelines", | ||
@@ -38,4 +38,4 @@ "main": "lib/main.js", | ||
"devDependencies": { | ||
"guy-test": "^1.4.2" | ||
"guy-test": "^2.0.1" | ||
} | ||
} |
@@ -413,3 +413,3 @@ | ||
* [ ] `text`—the underlying source text where code, data is parsed | ||
* [ ] `$` | ||
* [ ] `$`—'produced by' | ||
* [ ] `$ref`—do we still use this? See DataMill | ||
@@ -419,2 +419,3 @@ * [ ] `$pos`? `$range`? for `[ start, stop, ]` pairs, indices into a source; use inclusive or exclusive | ||
* [ ] `$loc`? for `[ line_nr, col_nr, ]` pairs; NB might also want to use stop position of ranges | ||
* [X] make `{ dirty: false, }` the default setting (i.e. not marking changed datoms) | ||
@@ -425,2 +426,1 @@ | ||
38
VNRs.md
@@ -8,2 +8,5 @@ <!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
- [Vectors of Numbers](#vectors-of-numbers) | ||
- [VNRs with Infinity](#vnrs-with-infinity) | ||
- [Prefixing and Suffixing (Deepening)](#prefixing-and-suffixing-deepening) | ||
- [XXXX](#xxxx) | ||
@@ -93,3 +96,4 @@ <!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
* submodule `vnr`, available as `DATOM.VNR` | ||
* lists of integers | ||
* lists of numbers; most frequently positive integers, but negative integers, fractional numbers and | ||
infinity may also be used | ||
* used to order datoms, standard property name is `$vnr` | ||
@@ -101,3 +105,35 @@ * ordering done per position in a lexicographic fashion, so | ||
* this is embodied in the `VNR.cmp a, b` method | ||
* VNRs like `[ -Infinity, ]` and `[ Infinity, ]` may be used to anchor elements at the beginning or the end | ||
of a sequence of arbitrary length | ||
## VNRs with Infinity | ||
Observe that while arbitrary amounts may be subtracted from or added to infinity without decreasing or | ||
increasing it (that is, `∞ = ∞ - 1`. `∞ = ∞ + 1`, which entails that the sorting order of two elements `{ | ||
id: 'A', nr: Infinity, }`, `{ id: 'B', nr: Infinity + 1, }` is undefined with respect to `nr`). | ||
However, with vectorial numbers, elements *can* be ordered both before and behind negative and positive | ||
infinity. | ||
This means that `{ id: 'A', $vnr: [ Infinity, ], }` will be sorted before `{ id: 'B', $vnr: [ Infinity, 1, | ||
], }`, so in a sense there are vectorial numbers 'greater than infinity' when `[ Infinity, ] ≺ [ Infinity, | ||
1, ]` (with `≺` 'precedes') is interpreted as `[ Infinity, ] < [ Infinity, 1, ]` (with `<` 'less than'). | ||
The practical utility for using `Infinity` as a VNR element lies in the ability to unambiguously anchor | ||
datoms to the beginning or the end of a given sequence. | ||
## Prefixing and Suffixing (Deepening) | ||
* Prefix VNRs with source numbers when two streams (sequences) are to be concatenated while keeping elements | ||
from different sources in separate segments | ||
* Suffix ('deepen') VNRs to | ||
* break apart a given datom, replacing it with several derived datoms | ||
* add one or several datoms behind or before a given datom | ||
* Use 'negative deepening' (i.e. suffix VNRs of new datoms with a negative number) to prepend, 'positive | ||
deepening' to append datoms with respect to a given datom; do both to surround it | ||
# XXXX | ||
**`### TAINT reformulate: ###`** | ||
@@ -104,0 +140,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2050
248103