« Return to Thread: Re: is there no solution?

Re: is there no solution?

by Jorge Ortiz-3 :: Rate this Message:

Reply to Author | View in Thread

There's also syntax for early initialization:

  class Abstract {
    val a: Int
    validate()
  }

  class Concrete extends {
    val a = 5
  } with Abstract {
    val b = 10
  }

Eventually there will a different syntax for early initialization (not yet):

  class Concrete extends Abstract {
    val a = 5
    super
    val b = 10
  }

--j

On Tue, Jul 7, 2009 at 10:56 PM, Vlad Patryshev <vpatryshev@...> wrote:
Omg. Yes! It worked. (so idiomatic...)

2009/7/7 Naftoli Gugenhem <naftoligug@...>

Or a lazy val?

-------------------------------------
Vlad Patryshev<vpatryshev@...> wrote:

Hi,
I have a couple of abstract val's in my abstract class; subclasses provide
the value for those vals.
Now in this abstract class I call a validator - which uses those values; but
the values are not instantiated by the moment the validator is called (in
the body of the class).

One solution would be to have a def instead of val; then it works, but it is
a little bit more cluttered.

Seems like a general problem, right?

--
Thanks,
-Vlad



--
Thanks,
-Vlad

 « Return to Thread: Re: is there no solution?