// Create a PVector from a slice (of interface{}) func NewPVectorFromSlice(items []interface{}) *PVector { // TODO: redo when we have transients var ret iseq.PVector = EmptyPVector for _, item := range items { ret = ret.ConsV(item) } return ret.(*PVector) }
// Create a PVector from an ISeq func NewPVectorFromISeq(items iseq.Seq) *PVector { // TODO: redo when we have transients var ret iseq.PVector = EmptyPVector for ; items != nil; items = items.Next() { ret = ret.ConsV(items.First()) } return ret.(*PVector) }