- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Re: question about "function type inheritance" in scala
Sun, 2010-07-18, 19:15
Thanks for the quick responses, Luc and Randall! I'm mulling over this
new info now
On Sunday, July 18, 2010, Randall R Schulz wrote:
> On Sunday July 18 2010, Randall R Schulz wrote:
>> On Sunday July 18 2010, John Fries wrote:
>> > Scala folk,
>> >
>> > I'm a newbie reading "Programming in Scala", and I'm trying to make
>> > sense of a statement made on pg 9 (Section 1.2: What makes Scala
>> > scalable?). The statement is:
>> > "Function types are classes that can be inherited from subclasses."
>> >
>> > I know that I can create new classes, and I know that functions are
>> > objects and hence have a type.
>> > I don't yet know how/if scala distinguishes between a type and a
>> > class, but for now I'm not assuming that there is a distinction.
>>
>> Types and classes exist in Scala. Classes exist at runtime and any
>> given class may represent
>
> Oops. I never came back and finished my thought there...
>
> A class, in particular a generic class, may represent many types. Also
> the existence of structural typing in Scala means that any class with
> the set of members (vals, vars and defs) M conforms to all the types
> corresponding to the power set of M.
>
>
> Randall Schulz
>