Use a more ergonomic representation for StructuredMap keywords #239
Labels
No labels
A-build
A-cli
A-core
A-design
A-edn
A-ffi
A-query
A-sdk
A-sdk-android
A-sdk-ios
A-sync
A-transact
A-views
A-vocab
P-Android
P-desktop
P-iOS
bug
correctness
dependencies
dev-ergonomics
discussion
documentation
duplicate
enhancement
enquiry
good first bug
good first issue
help wanted
hygiene
in progress
invalid
question
ready
size
speed
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: greg/mentat#239
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
StructuredMap
maps from keywords to variousBinding
instances (which can also beStructuredMap
s).Those keywords can come from the database, or they can be aliases provided by the user inside a query string.
For efficiency, the keys to the map are actually
ValueRc<Keyword>
, where all maps generated during a run share keys. That means lookup into the map requires creating anArc
!More ergonomic ways to do this must exist.
We could have the keys to the map be references, or indices, or be in some way comparable to strings. Doing so would probably need some help from Rental.
We could push refcounting down into
Keyword
— after all, that's now just a more sophisticated box around a string.We could explicitly intern keywords into some kind of enclosing result set 'context'. Doing so would impose a burden on the eventual consumer of results — it would no longer be meaningful to grab a map out of a result and pass it around without the context — but perhaps we could invert the relationship and have the dictionary itself be refcounted inside
StructuredMap
!Lots of options, and a little thought needed.