operator length # supports linked-list

This commit is contained in:
2026-05-18 08:56:44 +02:00
parent eda3037855
commit 35a599b284
+2
View File
@@ -37,6 +37,8 @@ func evalLength(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
} else if kern.IsDict(childValue) {
m, _ := childValue.(*kern.DictType)
v = int64(len(*m))
} else if lls, ok := childValue.(*kern.LinkedList); ok {
v = int64(lls.Len())
} else if it, ok := childValue.(kern.Iterator); ok {
v = int64(it.Count())
// if extIt, ok := childValue.(ExtIterator); ok && extIt.HasOperation(CountName) {