mbstavola
04/05/2017, 5:08 PMRuckus
04/05/2017, 5:16 PMRuckus
04/05/2017, 5:17 PMcbruegg
04/05/2017, 5:23 PMkevinmost
04/05/2017, 5:31 PMHow would you defend against reflection access?To be fair,
val
doesn't mean anything either if you use reflection, but we still think it's a good language feature
How would Java interop work?There's no real way for it to. We do have a few features like reified that don't work in Java though
Ruckus
04/05/2017, 5:34 PMmbstavola
04/05/2017, 5:45 PMRuckus
04/05/2017, 5:52 PMkevinmost
04/05/2017, 5:58 PMCloseable.use { ... }
could declare that it "consumed" the Closeable (by moving it into its scope). You would have some safety that after closing a resource, you can't reuse it.
Or an Iterable's forEach function could consume it, for example, and you wouldn't try to reuse itilya.gorbunov
04/05/2017, 6:33 PMOr an Iterable's forEach function could consume itThere's nothing wrong with iterating an iterable second time. Did you mean an Iterator?
kevinmost
04/05/2017, 7:13 PMmbstavola
04/05/2017, 9:03 PMgroostav
04/07/2017, 10:22 PMThere's nothing wrong with iterating an iterable second timeunfortunately this depends on the source doesnt it? a sequence that was created off an iterator instance would not be iterable multiple times. the java 8 streams API has a similar characteristic. If we had semantics like these it might be nice to differentiate on types that do support them and types that dont support them. But I also feel like its worth mentioning that with the propagation of functional programming, we've also been propagating immutable types. Doesn't judicious use of immutable types solve this problem?
ilya.gorbunov
04/07/2017, 10:25 PMkevinmost
04/07/2017, 10:45 PM