Carry a MEOS struct that is all scalars as a value - #28
Merged
estebanzimanyi merged 1 commit intoSep 3, 2026
Merged
Conversation
A struct MEOS hands over through a pointer is not always opaque. Where the
catalog states its whole layout in scalars and no class stands for it, the
address carries nothing the value does not: `Interval`, `Match`, `BOX3D`,
`AFFINE` and `TimeTzADT` are values, and the binding carries them as such. The
argument sites take the value and hand MEOS the address of a copy that lives
exactly as long as the call; the return sites read the value MEOS wrote and
leave the memory to MEOS, as every other value the layer reads back does. 49
methods reach the object layer that way — `TsTzSpan.Duration`,
`Span.ShiftScale`, `Temporal.Tprecision`, `TsTzSpanSet.Bins`,
`Temporal.FrechetPath` and their kin — 1171 methods against 1122, 124 deferred
against 171.
A value struct reads and writes itself through the text I/O the catalog names
for it, so `Interval.In("1 day")` goes through MEOS's own parser and
`ToString()` through its printer, at the decimal digits the catalog's encoding
records. Nothing about the format is stated twice.
The rule excludes a struct a class already stands for, which is what keeps
`Npoint` and `Nsegment` one type each rather than a class and a struct spelling
the same value.
Four tests read the values back: a span answers its duration as an interval of
2 days, an interval round-trips its own text and raises on text MEOS refuses, a
span shifted and scaled by two intervals given as values lands where it should,
and a Frechet path arrives as the matches themselves — in the order the kernel
walks its distance matrix, from the last pair back to the first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A struct MEOS hands over through a pointer is not always opaque. Where the
catalog states its whole layout in scalars and no class stands for it, the
address carries nothing the value does not:
Interval,Match,BOX3D,AFFINEandTimeTzADTare values, and the binding carries them as such. Theargument sites take the value and hand MEOS the address of a copy that lives
exactly as long as the call; the return sites read the value MEOS wrote and
leave the memory to MEOS, as every other value the layer reads back does. 49
methods reach the object layer that way —
TsTzSpan.Duration,Span.ShiftScale,Temporal.Tprecision,TsTzSpanSet.Bins,Temporal.FrechetPathand their kin — 1171 methods against 1122, 124 deferredagainst 171.
A value struct reads and writes itself through the text I/O the catalog names
for it, so
Interval.In("1 day")goes through MEOS's own parser andToString()through its printer, at the decimal digits the catalog's encodingrecords. Nothing about the format is stated twice.
The rule excludes a struct a class already stands for, which is what keeps
NpointandNsegmentone type each rather than a class and a struct spellingthe same value.
Four tests read the values back: a span answers its duration as an interval of
2 days, an interval round-trips its own text and raises on text MEOS refuses, a
span shifted and scaled by two intervals given as values lands where it should,
and a Frechet path arrives as the matches themselves — in the order the kernel
walks its distance matrix, from the last pair back to the first.