« Return to Thread: [scala] fixed array type

[scala] Re: fixed array type

by Jesper Nordenberg :: Rate this Message:

Reply to Author | View in Thread

Paul Phillips wrote:

> On Tue, Jun 16, 2009 at 03:24:10PM -0700, Balthazar Crowley wrote:
>> Thanks for the response. Unfortunately, that expression does not
>> denote a type. And the type of the thing it does denote is not what is
>> required.
>
> Oh, it sounds like you want a dependent type.
>
> That is, the type "Array[Char] of length 140." Right?
>
>   http://en.wikipedia.org/wiki/Dependent_type
>
> You can't have that in scala or any remotely mainstream language, but it
> is one of my fonder hopes for the future.

Actually I believe it can be done in C++ (C++ templates are after all
TC), which I consider a mainstream language. It can probably be done in
Scala as well (type projections are TC as well), but it would be
impractical given the current compiler status.

/Jesper Nordenberg

 « Return to Thread: [scala] fixed array type