init reader for lists
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user