Skip to content

Add incredibly naive ENSV Reader and Writer#3

Merged
namingbe merged 7 commits intomasterfrom
claude/add-ensv-support-ASAvq
Mar 14, 2026
Merged

Add incredibly naive ENSV Reader and Writer#3
namingbe merged 7 commits intomasterfrom
claude/add-ensv-support-ASAvq

Conversation

@namingbe
Copy link
Copy Markdown
Collaborator

No interpretation of metadata, only storage. Doesn't handle the case where the metadata is not fully available from the outset. Does not handle finalization. Forces metadata writing onto the user. Maybe I should focus on methods extracting and encoding metadata as a seqseq? But then, the classes make it more convenient if the user doesn't need that level of control. Anyway, would do for now.

claude added 7 commits March 14, 2026 17:00
Metadata (inert config): columns, types, bool sentinels, table width,
unknown forms. Parses from/serializes to lifted metadata rows.

ENSVReader: reusable stateful converter with settable .meta property.
read() yields converted rows lazily with width validation.

peel(): consume one element from an iterator, return (Metadata, tail).
read(): one-shot convenience returning iterator with .meta attribute.
encode(): metadata + data -> seqseq for nsv.dumps.

https://claude.ai/code/session_018keUYHFdMPKVUXkfE4LdCs
- Remove __eq__/__repr__ from UnknownForm (test concern, not live code)
- Split overloaded table field into table (bool) + width (int|None)
- Compare unknown forms by fields in Metadata.__eq__

https://claude.ai/code/session_018keUYHFdMPKVUXkfE4LdCs
Remove Metadata, ENSVReader, type conversion, encode, and all
associated machinery. The module now exports lift, unlift, and peel.
peel consumes one row from an iterator and returns (seqseq, tail).

https://claude.ai/code/session_018keUYHFdMPKVUXkfE4LdCs
split: find first empty row, return (meta seqseq, offset, data).
join: inverse of split, concatenates meta + empty row + data.
Aligns with spec's spill[Seq[String], []] for metadata separation.

https://claude.ai/code/session_018keUYHFdMPKVUXkfE4LdCs
Reader: consumes meta rows until empty row separator, exposes .meta,
then yields data rows on iteration.
Writer: write_meta() writes forms + empty row, then write_row()/write_rows()
for data, delegating to NSV Writer.

https://claude.ai/code/session_018keUYHFdMPKVUXkfE4LdCs
@namingbe namingbe merged commit 346ce3e into master Mar 14, 2026
10 checks passed
@namingbe namingbe deleted the claude/add-ensv-support-ASAvq branch March 14, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants