Linked-list: added support for operators '<<' and '>>'. Also fixed list insertion: ['x'] >> [1,2] must return [1,2,['x'], not [1,2,'x']; use $([]) to flat a list

This commit is contained in:
2026-05-22 06:46:04 +02:00
parent ac5c97bfd3
commit 4b2b573420
4 changed files with 48 additions and 31 deletions
+9
View File
@@ -11,6 +11,15 @@ import (
"git.portale-stac.it/go-pkg/expr/scan"
)
func NewFormalIterator(value any) (it kern.Iterator) {
if value == nil {
it = NewArrayIterator([]any{})
} else {
it = NewArrayIterator([]any{value})
}
return
}
func NewIterator(ctx kern.ExprContext, value any, ops []*scan.Term) (it kern.Iterator, err error) {
if value == nil {
return NewArrayIterator([]any{}), nil