You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Clojure-style #{...} set literal syntax to PTC-Lisp. Sets are currently explicitly not supported (LLMs commonly use this syntax causing parse errors). This epic implements MapSet-based sets with O(1) membership, silent deduplication, and minimal operations.
Critical regression risk in Phase 5: MapSet is a struct, so is_map(%MapSet{}) returns true. All functions with when is_map(coll) guards will incorrectly match MapSet and crash (expecting {k, v} tuples). Must add explicit %MapSet{} clauses BEFORE generic is_map clauses.
Design decisions:
Silent deduplication (#{1 1 2} → #{1 2}) for LLM-friendliness
coll? returns false for sets (separate set? predicate)
Collection ops (map, filter, remove) return vectors, not sets
Set Literal Syntax (#{...}) for PTC-Lisp
Overview
Add Clojure-style
#{...}set literal syntax to PTC-Lisp. Sets are currently explicitly not supported (LLMs commonly use this syntax causing parse errors). This epic implements MapSet-based sets with O(1) membership, silent deduplication, and minimal operations.Specification Documents
Progress
Phase 1: Parser
#{...}parsing to parser.ex and parser_helpers.exPhase 2: AST Types
{:set, [t()]}to ast.ex and core_ast.ex type specsPhase 3: Analyzer
Phase 4: Evaluator
Phase 5: Runtime (Critical - MapSet/is_map fix)
set?,setfunctions and MapSet-safe collection opsPhase 6: Formatter
#properly)Phase 7: Documentation
Phase 8: Tests
Notes
Critical regression risk in Phase 5: MapSet is a struct, so
is_map(%MapSet{})returnstrue. All functions withwhen is_map(coll)guards will incorrectly match MapSet and crash (expecting{k, v}tuples). Must add explicit%MapSet{}clauses BEFORE genericis_mapclauses.Design decisions:
#{1 1 2}→#{1 2}) for LLM-friendlinesscoll?returnsfalsefor sets (separateset?predicate)map,filter,remove) return vectors, not sets