rfc:structural-typing-for-closures
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:structural-typing-for-closures [2023/04/13 16:05] – nicolasgrekas | rfc:structural-typing-for-closures [2023/04/14 07:02] – nicolasgrekas | ||
---|---|---|---|
Line 5: | Line 5: | ||
* Author: Larry Garfield < | * Author: Larry Garfield < | ||
* Status: Draft | * Status: Draft | ||
- | * First Published at: https:// | + | * First Published at: https:// |
+ | * Implementation: | ||
===== Introduction ===== | ===== Introduction ===== | ||
Line 13: | Line 14: | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | Given an interface with only an '' | + | Given an interface with only an '' |
This would encourage developers to define more explicit and expressive type declarations, | This would encourage developers to define more explicit and expressive type declarations, | ||
Line 44: | Line 45: | ||
===== Open Questions ===== | ===== Open Questions ===== | ||
- | * What would be the performance impact of adding this feature to the language, considering the engine would need to verify the closure signatures at runtime? | + | * What would be the performance impact of adding this feature to the language, considering the engine would need to verify the closure signatures at runtime? Could this be cached internally? |
* Should reflection know something about this? | * Should reflection know something about this? | ||
+ | |||
+ | ===== Future Scope ===== | ||
+ | |||
+ | * Auto-cast closures to interfaces that have a single method that is not necessarily named '' | ||
+ | * Allow closures to declare the interface they implement as in e.g. '' | ||
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== | ||
Line 51: | Line 57: | ||
This RFC proposes a straight Yes/No vote. A two-thirds majority is required for acceptance. | This RFC proposes a straight Yes/No vote. A two-thirds majority is required for acceptance. | ||
- | ===== Implementation ===== | ||
- | |||
- | TBD |
rfc/structural-typing-for-closures.txt · Last modified: 2023/04/20 16:16 by nicolasgrekas