operand-list.go: ListType constructor functions newList() and newListA()
This commit is contained in:
parent
5378952394
commit
f342dfe9f3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user