The name of 'list' has been changed to 'array'; from now on, 'list' will refer to the linked list.
This commit is contained in:
+3
-3
@@ -34,7 +34,7 @@ func newAppendTerm(tk *scan.Token) (inst *scan.Term) {
|
||||
}
|
||||
|
||||
func prependToList(opTerm *scan.Term, leftValue, rightValue any) (result any, err error) {
|
||||
if a, ok := rightValue.(*array.ListType); ok {
|
||||
if a, ok := rightValue.(*array.ArrayType); ok {
|
||||
var it kern.Iterator
|
||||
if it, ok = leftValue.(kern.Iterator); !ok {
|
||||
it = NewFormalIterator(leftValue)
|
||||
@@ -43,7 +43,7 @@ func prependToList(opTerm *scan.Term, leftValue, rightValue any) (result any, er
|
||||
ls := list.NewLinkedList()
|
||||
ls.SeqPushBack(it)
|
||||
|
||||
newArray := array.ListType(nil)
|
||||
newArray := array.ArrayType(nil)
|
||||
if newSize := len(*a) + int(ls.Len()); newSize > cap(*a) {
|
||||
newArray = make([]any, 0, newSize)
|
||||
for node := ls.FirstNode(); node != nil; node = node.Next() {
|
||||
@@ -79,7 +79,7 @@ func evalPrepend(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
|
||||
}
|
||||
|
||||
func appendToList(opTerm *scan.Term, leftValue, rightValue any) (result any, err error) {
|
||||
if a, ok := leftValue.(*array.ListType); ok {
|
||||
if a, ok := leftValue.(*array.ArrayType); ok {
|
||||
var it kern.Iterator
|
||||
if it, ok = rightValue.(kern.Iterator); !ok {
|
||||
it = NewFormalIterator(rightValue)
|
||||
|
||||
Reference in New Issue
Block a user