[Types-sig] List of FOO
Paul Prescod
paul@prescod.net
Mon, 13 Dec 1999 21:55:07 -0800
> > #2. The first version of the system will not allow the use of types
> > that cannot be referred to as simple Python objects. In particular it
> > will not allow users to refer to things like "List of Integers" and
> > "Functions taking Integers as arguments and returning strings."
>
> It's been said before: that's a shame. Type inference is seriously
> hindered if it doesn't have such information. (Consider a loop over
> sys.argv; I want the checker to be able to assume that the items are
> strings.)
It took two years to get the parameterized version of the Java type
system up and running. 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" and what about "callable taking
list of callables taking <T> and R returning list of callables taking
<R> and returning <T>." You see my problem? I could special case "list
of" as Java and C did if we agreed to take our chances that my syntax
would be extensible. We could even steal that weird "[]" thing that C
and Java do:
StringType [] foo
--
Paul Prescod - ISOGEN Consulting Engineer speaking for himself
"Unwisely, Santa offered a teddy bear to James, unaware that he had
been mauled by a grizzly earlier that year." - Timothy Burton, "James"