# `PtcRunner.Lisp.Runtime.FlexAccess`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/lisp/runtime/flex_access.ex#L1)

Flexible key access helpers for PTC-Lisp runtime.

These helpers allow accessing map keys using either atom or string versions,
with hyphen/underscore normalization for seamless interoperability between
Clojure-style keywords (`:turn-summaries`) and Elixir-style keys (`:turn_summaries`).

## Lookup order

1. Exact match (atom or string as given)
2. Atom↔string variant (`:foo` → `"foo"` or vice versa)
3. Hyphen↔underscore normalized variant (`:turn-summaries` → `:turn_summaries`, `"turn_summaries"`)

# `flex_fetch`

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.

# `flex_fetch_in`

Flexible nested key fetch: try both atom and string versions at each level.
Returns {:ok, value} if found, :error if missing.

# `flex_get`

Flexible key access: try atom/string and hyphen/underscore variants 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.

# `flex_get_in`

Flexible nested key access: try both atom and string versions at each level.

# `flex_put_in`

Flexible nested key insertion: creates intermediate maps as needed at each level.
Aligns with Clojure's assoc-in behavior.

# `flex_update_in`

Flexible nested key update: creates intermediate maps as needed at each level.
Aligns with Clojure's update-in behavior.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
