[Types-sig] List of FOO

Tim Peters tim_one@email.msn.com
Wed, 15 Dec 1999 04:08:44 -0500


[Paul Prescod]
> It took two years to get the parameterized version of the Java type
> system up and running.

Ya, but they took this stuff seriously <wink>.

> Let me ask this your opinion on this question (seriously, not
> sarcastically), should we include a spelling for "list of
> string"

[""]

> and not "callable taking list of callables taking strings returning
> integers returning string"

["" -> 0] -> ""

> and what about "callable taking list of callables taking <T>
> and R returning list of callables taking <R> and returning <T>."

The last "returning <T>" is ambiguous.  You may mean:

    [(T, R) -> [R -> None]] -> T

or

    [(T, R) -> [R -> T]] -> None

> You see my problem?

I don't.  The convolution comes not from the concepts but from the attempt
to express them in English.  If the formalism introduced above is too
concise, there are a gazillion other ways to spell it; e.g.,

List of String
Func(List of Func(String)->Int)->String
Func(List of Func(T, R)->List of Func(R))->T
Func(List of Func(T, R)->List of Func(R)->T)

> I could special case "list of" as Java and C did if we agreed to
> take our chances that my syntax would be extensible.

Ack, no -- start with a general scheme, so special cases aren't necessary.
Although it's *pleasant* if Python's builtin types get especially nice
syntax.  BTW, the concise form above is much like what Haskell uses.

panic-is-always-premature-ly y'rs  - tim