Answer the value at a timestamp from the MEOS entry that reports absence - #21
Merged
estebanzimanyi merged 1 commit intoSep 3, 2026
Conversation
WITNESS: a temporal value holds nothing outside its own span, and MEOS says so
by answering NULL. `CreateTemporal` reads `inner.temptype` with no nil test, so
that answer is dereferenced: removing the guard this commit adds takes
`ExampleCreateTemporal_absent` to
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x4]
and 119 call sites reach `CreateTemporal` with a result that can be NULL.
The five `ValueAtTimestamp` accessors compose that path -- each one calls
`TemporalAtTimestamptz`, discards the conversion error with `_`, and reads the
instant -- where MEOS publishes the question directly:
`tbool_value_at_timestamptz(temp, t, strict, &value)` reports whether a value
is there and writes it out, with twins for tint, tfloat, ttext and tgeo. The
generated package already wraps all five, so the accessors delegate to them
across the pointer boundary rather than composing a restriction.
THE SHAPE COMES FROM THE SIBLING BINDINGS, WHICH SEPARATE ABSENCE FROM ERROR.
MEOS.NET's generated accessors return a nullable -- `public bool?
ValueAtTimestamptz(DateTime t, bool strict)`, and `int?` / `long?` / `double?`
for its siblings -- with `Assert.IsNull` covering the absent case in its own
test, while errors travel out of band through `SafeExecution`. PyMEOS-CFFI
agrees: `if result: return out_result[0] ... return None`, with `_check_error()`
raising separately. So absence is an optional result, not a failure. Go spells
an optional as a second result, and the generated wrapper here already returns
`(found, value, error)`, so the accessors return `(value, ok, error)`: `ok`
false leaves the value at its zero and the error nil, and the error is reserved
for a MEOS failure.
MEASURED: the suite reads 121 result lines, 0 skipped, against 118 before. The
three added examples pin the absent case for the boolean and float accessors
and for `CreateTemporal` itself, and each fails with the guard removed, so they
witness this change rather than accompany it.
estebanzimanyi
force-pushed
the
fix/value-at-timestamp-delegates
branch
from
September 3, 2026 10:05
49715b9 to
0c70563
Compare
estebanzimanyi
added a commit
that referenced
this pull request
Sep 3, 2026
GoMEOS ships a generated flat FFI layer and a hand-written idiomatic one, so every class, method and conversion above the wrappers is written and maintained by hand. The catalog already states that layer: `objectModel.lattice` carries the temporal tree, `companions` the Box, Collection and Value hierarchies, and `classes.<Class>.methods` assigns each public MEOS function to the class it is a method of, under its canonical camelCase `ooName`. MEOS.NET projects the same model through its own `tools/objectgen.py`; this is the Go projection of it. Go spells inheritance as embedding, so `TBool` embeds `TAlpha` embeds `Temporal` and a parent's methods are promoted. Each instance carries the MEOS pointer, and the two packages exchange it as an `unsafe.Pointer`, because cgo types are package-scoped and `*C.Temporal` in `functions` is not the same Go type as one declared here. THE SIGNATURES COME FROM `codegen.SIGNATURES`, so the two generators cannot disagree. MEOS declares `bool tbool_value_at_timestamptz(..., bool *value)` -- four parameters, one of them written through -- while the wrapper takes three and answers two values. Reading the C signature would reconstruct a shape the wrapper does not have. The table is filled by RUNNING the flat generator, so which functions have a wrapper is decided in one place and this file holds no second copy of what that generator skips. ABSENCE STAYS AN OPTIONAL, in the shape this repository already merged: where MEOS answers a flag and writes the value out, the method answers `(value, ok, error)` with `ok` false leaving the value at its zero and the error nil. `TBool.ValueAtTimestamptz` is generated to exactly what #21 hand-wrote. MEASURED against a catalog derived at current master: 115 classes, 1256 methods, 105 deferred, each deferral naming the parameter or result that stopped it rather than being dropped silently. `go build ./types ./functions` and `go vet ./types` both exit 0, `gofmt -l` reports 0 of 116 files, and a second run of the generator reproduces the tree byte for byte. The layer is ADDITIVE: the root package is untouched, so no published name moves.
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.
WITNESS: a temporal value holds nothing outside its own span, and MEOS says so
by answering NULL.
CreateTemporalreadsinner.temptypewith no nil test, sothat answer is dereferenced: removing the guard this commit adds takes
ExampleCreateTemporal_absenttoand 119 call sites reach
CreateTemporalwith a result that can be NULL.The five
ValueAtTimestampaccessors compose that path -- each one callsTemporalAtTimestamptz, discards the conversion error with_, and reads theinstant -- where MEOS publishes the question directly:
tbool_value_at_timestamptz(temp, t, strict, &value)reports whether a valueis there and writes it out, with twins for tint, tfloat, ttext and tgeo. The
generated package already wraps all five, so the accessors delegate to them
across the pointer boundary rather than composing a restriction.
THE SHAPE COMES FROM THE SIBLING BINDINGS, WHICH SEPARATE ABSENCE FROM ERROR.
MEOS.NET's generated accessors return a nullable --
public bool? ValueAtTimestamptz(DateTime t, bool strict), andint?/long?/double?for its siblings -- with
Assert.IsNullcovering the absent case in its owntest, while errors travel out of band through
SafeExecution. PyMEOS-CFFIagrees:
if result: return out_result[0] ... return None, with_check_error()raising separately. So absence is an optional result, not a failure. Go spells
an optional as a second result, and the generated wrapper here already returns
(found, value, error), so the accessors return(value, ok, error):okfalse leaves the value at its zero and the error nil, and the error is reserved
for a MEOS failure.
MEASURED: the suite reads 121 result lines, 0 skipped, against 118 before. The
three added examples pin the absent case for the boolean and float accessors
and for
CreateTemporalitself, and each fails with the guard removed, so theywitness this change rather than accompany it.