Skip to content

Commit 0385ab6

Browse files
miharpclaude
andcommitted
Correct the Data and RichData membership lists
RichData omitted several types that it matches but Data does not: URI, regular expressions, and resource and class references. Correcting that exposed two errors in the existing Data section. Data was described as matching any value that would match Scalar, but it is built on ScalarData, so a regular expression matches Scalar and not Data. Its hashes were described as taking keys that match Scalar, but only string keys are accepted at runtime; integer, float, and boolean keys are all rejected. Verified against OpenVox 8.28.1 by sweeping every candidate type for RichData and Data membership. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Michael Harp <mike@mikeharp.com>
1 parent 49b71ca commit 0385ab6

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

docs/_openvox_8x/lang_data_abstract.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ title: "Language: Data types: Abstract data types"
1313
[hash_missing_key_access]: ./lang_data_hash.html#accessing-values
1414
[numbers]: ./lang_data_number.html
1515
[semver]: ./lang_data_semver.html
16+
[uri]: ./lang_data_uri.html
1617
[time]: ./lang_data_time.html
1718
[binary]: ./lang_data_binary.html
1819
[error]: ./lang_data_error.html
@@ -287,13 +288,15 @@ It takes no parameters.
287288

288289
### `Data`
289290

290-
The `Data` data type matches any value that would match `Scalar`, but it also matches:
291+
The `Data` data type matches any value that would match `ScalarData`, but it also matches:
291292

292293
* `undef`
293294
* [Arrays][] that only contain values that would also match `Data`
294-
* [Hashes][] whose keys would match `Scalar` and whose values would also match `Data`
295+
* [Hashes][] whose keys are [strings][] and whose values would also match `Data`
295296

296-
Note that it doesn't match `default` or resource references.
297+
Note that it is built on `ScalarData` rather than `Scalar`, so the members of `Scalar` that have no JSON
298+
equivalent are excluded: a regular expression matches `Scalar` but not `Data`. It also doesn't match
299+
`default` or resource references.
297300

298301
It takes no parameters.
299302

@@ -304,12 +307,15 @@ It takes no parameters.
304307
The `RichData` data type matches any value that would match `Data`, and also matches the types that have no
305308
direct JSON equivalent:
306309

310+
* [Regular expressions][]
311+
* [`URI`][uri]
307312
* [`Binary`][binary]
308313
* [`Timestamp` and `Timespan`][time]
309314
* [`SemVer` and `SemVerRange`][semver]
310315
* [`Error`][error]
311316
* [`Sensitive`][sensitive]
312317
* Data types themselves, such as `Integer`
318+
* Resource and class references
313319
* `default`
314320
* [Arrays][] and [hashes][] containing any of the above
315321

0 commit comments

Comments
 (0)