about summary refs log tree commit diff stats
path: root/js/scripting-lang/TABLE_OPERATIONS_PLAN.md
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/TABLE_OPERATIONS_PLAN.md')
-rw-r--r--js/scripting-lang/TABLE_OPERATIONS_PLAN.md34
1 files changed, 34 insertions, 0 deletions
diff --git a/js/scripting-lang/TABLE_OPERATIONS_PLAN.md b/js/scripting-lang/TABLE_OPERATIONS_PLAN.md
new file mode 100644
index 0000000..68c005d
--- /dev/null
+++ b/js/scripting-lang/TABLE_OPERATIONS_PLAN.md
@@ -0,0 +1,34 @@
+# 🛠️ 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)
\ No newline at end of file