cbor-wg / cddl-control

New control operators for CDDL
Other
0 stars 0 forks source link

Array "subtraction" operator(s)? #4

Open cabo opened 3 years ago

cabo commented 3 years ago

Over in https://github.com/cbor-wg/cbor-oid/issues/3, we had a proposal to be able to do

root-sha2 = bytes .sdnvseq [ 60 840 1 101 3 4 2 ]
root-sha256 = byte .sdnvseq [ 60 840 1 101 3 4 2 1 ]
rel-sha25 = root-sha256 .oidrel root-sha2

(Note that the inverse (array concatenation) can already be done via unwrap and groups:

c = [~a, ~b]
a = [1, 2, 3]
b = [4, 5, 6]

➔ [1, 2, 3, 4, 5, 6])