# 🛠️ New Table Operations Implementation Plan ## 🎯 **Goal**: Add t.shape, t.append, t.prepend to both implementations ## 📊 **Current Status** - ✅ **C Implementation**: Functions added (with runtime issues) - ❌ **JavaScript Implementation**: Not yet implemented - ❌ **Tests**: No tests created for new operations - ❌ **Documentation**: Operations not tested ## 🚀 **Implementation Plan** ### **Phase 1: JavaScript Reference Implementation** (Next Priority) 1. Add `t.shape` to `js/lang.js` - returns `{size: number, type: "array"|"object"}` 2. Add `t.append` to `js/lang.js` - immutable append operation 3. Add `t.prepend` to `js/lang.js` - immutable prepend operation ### **Phase 2: Test Creation** 1. Create `tests/unit/18_new_table_operations.txt` 2. Test each new operation thoroughly 3. Verify JavaScript implementation works ### **Phase 3: Fix C Implementation** 1. Debug runtime issues in C functions 2. Align C behavior with JavaScript reference 3. Ensure all tests pass ## 🎯 **Expected Impact** - Enable table-based array simulation (replacing `[]` syntax) - Fix **Loops and State Management** test (uses array syntax) - Potentially fix other failing tests that need array operations ## 📋 **Strategic Priority** **Medium** - Should implement after fixing quicker wins (IO Operations, Advanced Functional Programming)