Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

iterable<T> / iterable<K, V> #337

Open
thekid opened this issue Nov 15, 2020 · 0 comments
Open

iterable<T> / iterable<K, V> #337

thekid opened this issue Nov 15, 2020 · 0 comments

Comments

@thekid
Copy link
Member

thekid commented Nov 15, 2020

Scope of Change

Two new generic types will be added to the XP type system: iterable<T> and iterable<K, V>, complementing the Type::$ITERABLE type union while making it more specific.

Rationale

A function returning iterable does not tell the user what to expect as values for the iteration.

Functionality

The simple one-component type iterable<T> will be mapped to lang.IterableType(key: null, value: T), while the two-component version iterable<K, V> will be represented to lang.IterableType(key: K, value: V) where T, K and V are lang.Type instances.

Security considerations

None

Speed impact

Slight impact of Type::forName() to check for the string "iterable".

Dependencies

XP Compiler support

Related documents

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant