operand-list.go: ListType constructor functions newList() and newListA()

This commit is contained in:
Celestino Amoroso 2024-05-06 15:30:23 +02:00
parent 5378952394
commit f342dfe9f3

View File

@ -46,6 +46,22 @@ func (ls *ListType) String() string {
return ls.ToString(0)
}
func newListA(listAny ...any) (list *ListType) {
return newList(listAny)
}
func newList(listAny []any) (list *ListType) {
if listAny != nil {
ls := make(ListType, len(listAny))
for i, item := range listAny {
ls[i] = item
}
list = &ls
}
return
}
// -------- list term
func newListTermA(args ...*term) *term {
return newListTerm(args)