[Types-sig] lambdas, classes, tuples, default arguments, map

Tony Lownds tony@metanet.com
Sun, 23 Jan 2000 11:13:38 -0800 (PST)


> Something's confused here, or the meanings of "|" and "&" got swapped when I
> wasn't looking <wink>.
 
The decl is saying that the same map function can conform to map1 *and*
map2 *and* map3. If it said map1 *or* map2 etc, then the programmer would
have to check to make sure the current value of the map variable is the 
alternative that can handle the way its about to be called.

> decl intlist: [int]
> intlist = map(ord, ["a", "b", "c"])
> 
> conforms to map1 in the instantiation
> 
>     map1<chr, int> = def(def(chr)->int, [chr]) -> [int]
> 
> but it certainly doesn't conform to any of the other map_i (ord doesn't take
> 2, or 3, or ... arguments!).  

Yes it does! Assuming the it you are referring to is the map function, not
some instantiation or something else. You can call that same function, the
same func_object, as map2 or map3 specifies.

> Since it conforms to (exactly) one of the
> map_i, it conforms to their union, not to their intersection.

No, it conforms to all at the same time. I wasn't using '&' as a
intersection operator but as a combination operator. 

-Tony