|
Re: The public interface of a program unit in Scala: msg#00455lang.scala
On 1/28/07, Vijay Saraswat <vijay@xxxxxxxxxxxx> wrote: (In the spirit of designing a language for readability vs writability.) Not that I know of. I think this would make very interesting research, though! In particular, what do I need to keep in my head about implicits Implicits are hairy, but can probably be left out of most of the discussion. Traits are interesting, as you have noted. Case classes and pattern matching don't add anything new, IMO. e.g. it seems the public interface needs to include the inheritance That's correct. However, I believe that you need not care about the inheritance graph of T in the following two situations: - If T is a class (because then inheritance graph of T will be in its entirety the prefix of every subclass/subtrait linearization. That is, subclasses or subtraits need not care about the order of classes in this linearization, it's sufficient to know what the set of base classes is. - If T is an interface (i.e. T has not state or methods, and the same is the case for T's parents). In that case, the linearization of T is uninteresting because it implements no behavior. So those Scala classes that are expressible in Java have the same public interface as in Java. Note that this is not trivially true. Since Scala has more ways to form classes and other program contexts, it would be conceivable that even a Java-like class or interface needs a richer public interface. However, I believe that this is not the case. Cheers -- Martin |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: assorted beginner questions: 00455, Rafael de F. Ferreira |
|---|---|
| Next by Date: | emulating Smalltalk syntax in Scala: snippet: 00455, Adriaan Moors |
| Previous by Thread: | The public interface of a program unit in Scalai: 00455, Vijay Saraswat |
| Next by Thread: | Trouble with intersection types: 00455, Miles Sabin |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |