1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-07-15 01:25:00 +02:00

Feature/#5 collect keyword alt (#141)

Implemented COLLECT key word
This commit is contained in:
Tim Voronov
2018-10-24 21:30:05 -04:00
committed by GitHub
parent b02c554214
commit 549b4abd3b
67 changed files with 4913 additions and 2811 deletions

View File

@ -31,12 +31,13 @@ func Unique(_ context.Context, args ...core.Value) (core.Value, error) {
}
iterator, err := collections.NewUniqueIterator(
collections.NewArrayIterator(arr),
collections.NewDefaultIndexedIterator(arr),
collections.DefaultValueVar,
)
if err != nil {
return values.None, err
}
return collections.ToArray(iterator)
return toArray(iterator)
}