Flexible key access helpers for PTC-Lisp runtime.
These helpers allow accessing map keys using either atom or string versions, providing seamless interoperability between different key formats.
Summary
Functions
Flexible key fetch: try both atom and string versions of the key. Returns {:ok, value} if found, :error if missing. Use this when you need to distinguish between nil values and missing keys.
Flexible nested key fetch: try both atom and string versions at each level. Returns {:ok, value} if found, :error if missing.
Flexible key access: try both atom and string versions of the key. Returns the value if found, nil if missing. Use this for simple lookups where you don't need to distinguish between nil values and missing keys.
Flexible nested key access: try both atom and string versions at each level.
Flexible nested key insertion: creates intermediate maps as needed at each level. Aligns with Clojure's assoc-in behavior.
Flexible nested key update: creates intermediate maps as needed at each level. Aligns with Clojure's update-in behavior.
Functions
Flexible key fetch: try both atom and string versions of the key. Returns {:ok, value} if found, :error if missing. Use this when you need to distinguish between nil values and missing keys.
Flexible nested key fetch: try both atom and string versions at each level. Returns {:ok, value} if found, :error if missing.
Flexible key access: try both atom and string versions of the key. Returns the value if found, nil if missing. Use this for simple lookups where you don't need to distinguish between nil values and missing keys.
Flexible nested key access: try both atom and string versions at each level.
Flexible nested key insertion: creates intermediate maps as needed at each level. Aligns with Clojure's assoc-in behavior.
Flexible nested key update: creates intermediate maps as needed at each level. Aligns with Clojure's update-in behavior.