init reader for lists

This commit is contained in:
2025-11-04 07:04:49 -10:00
parent f279d7c90a
commit 5200dfde00
4 changed files with 123 additions and 16 deletions
+14
View File
@@ -1,6 +1,7 @@
package vector
import (
"mal-go/list"
"mal-go/utils"
"strings"
)
@@ -49,3 +50,16 @@ func String(this *Vector) string {
func (this *Vector) String() string {
return String(this)
}
func ToList(this *Vector) *list.List {
var l *list.List
l = nil
for i := len(this._slice) - 1; i >= 0; i-- {
l = list.Conj(l, this._slice[i])
}
return l
}
func (this *Vector) ToList() *list.List {
return ToList(this)
}