Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
ivan_gammel
on Jan 5, 2023
|
parent
|
context
|
favorite
| on:
Microfeatures I'd like to see in more languages
No, but I think that was a good choice. In local code this is great, but in an interface contract being explicit about data type is a virtue.
andix
on Jan 5, 2023
|
next
[–]
For interfaces this would obviously not work (there is no implementation). But for class members it would.
I think this concept works very well in typescript and F#.
ivan_gammel
on Jan 6, 2023
|
parent
|
next
[–]
I mean interface not as a language construct, but as a declaration of how module (class, component etc) can be used. You want to see the type in such declaration, not to infer it based on implementation details.
gpderetta
on Jan 6, 2023
|
prev
[–]
But rust still allows declaring returning a trait instead of explicit types.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: