--
You received this message because you are subscribed to the Google Groups "scala-debate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-debate...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
val X = 5 instead
val X = 5 instead
i meant, the point of type inference is to skip the type info instead of spamming it or a less useful placeholder everywhere
i meant, the point of type inference is to skip the type info instead of spamming it or a less useful placeholder everywhere
Couldn't one argue that val/var is that placeholder in Scala?
--
type inference.instead ofval x: X = 5you can writeval x = 5and it is clear what you mean if the type is optionalbut if the type comes firstval X x = 5you could writeval X = 5 instead
--
--
Russ, do you know of any language that uses that (or equivalent) syntax? I think the point is to give comparisons to things people already know, not to comprehensively survey syntax space and show that a: A is the best possible.
def Int: someFunction(...) = ...rather thandef someFunction(...): Int = ...I have actually considered writing my own little pre-processor to reverse the order just for fun, but it wouldn't be of much value if I was the only one who used it. As I said earlier, I would like to see a compiler option to reverse the order if it could be done without too much effort.
The latter just seems more logical to me because 5 is being assigned to x, not to Int. And the "x = 5" part is consistent with what would appear with type inference:
--
You received this message because you are subscribed to a topic in the Google Groups "scala-debate" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scala-debate/SA6yJR8MTAk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scala-debate...@googlegroups.com.
--
(I do mind that you can't do stuff like [val A; val B; val C = A & B], but that's an orthogonal issue.)
--
You received this message because you are subscribed to the Google Groups "scala-debate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-debate...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.