Do you want to make extends non-optional (which imo would be confusing) or to prohibit extends without ClassTemplate?
Martin, what's your opinion? SHall we deprecate it for 2.11?
An additional point why getting rid of it is that it's too easy to confuse with early initializers if the user doesn't read things carefully enough. (See also the other thread where this already happened.)
--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I'd be in favor to leave it as is.class C extends { ... }makes sense. It defines a class type which is a subtype of the type in the braces. You could argue thatclass C { ... }is the irregular form, which is nevertheless good to have, because it is shorter. So I think little is gained by changing things now.
--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Well.. The spec of the DOT calculus uses /\ and \/ for type union/intersection operations (for that matter, so does shapeless and scalaz)So you might well see a symbolic for in Scala 3.x, presumably using `with` as an alias for backwards compatibility.
--
You received this message because you are subscribed to the Google Groups "scala-internals" group.To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
If you don't deprecate extends (I agree), shouldn't this also be possible?class C extends T with { val a: Int }
On Mon, Dec 9, 2013 at 1:45 PM, Jan Vanek <j3v...@gmail.com> wrote:
If you don't deprecate extends (I agree), shouldn't this also be possible?class C extends T with { val a: Int }It's a close call, but I would say, no.{ val a: Int }is a refinement; it applies to the type that comes before. If that type is missing, we assume AnyRef. But
Hi Matthew,I use early initializers in a couple of places in Rapture.
Here's one simplified use-case:class StringOutput extends {private val sw = new StringWriter} with CharOutput(sw) {def buffer: String = sw.toString}I need to be able to refer to the same `sw` in the parameter to `CharOutput` and in the definition of `buffer` (where the parameter to `CharOutput` is only a constructor parameter, not a member).Jon
The plan is to look into traits that can have parameters, like classes can. In that case, we would not need early definitions anymore, because the parameter mechanism would be good enough.
--
Until then, rather than "pre-initialized fields," "early initializers," or "early definitions," we could call them whatever the French word is for "in lieu of parameterized traits."
--
--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
A naked refinement{ ... }is a shorthand forAnyRef { ... }Soclass C extends { ... }is a shorthand forclass C extends AnyRef { ... }