Tags: koto-lang/koto
Tags
Allow iterator adaptors to be used as standalone functions (#404) Backport of e2bf2b5 The instance checks in the `iterator` module use `KValue::is_iterable` to decide whether or not to accept the instance provided to the call. When used as standalone functions, adaptors like `iterator.enumerate(1..10)` were accepting the `iterator` module causing an error to be thrown. The fix is to extend the `is_iterable` logic to only accept object-like maps if they implement `@iterator` or `@next`.
PreviousNext