[Types-sig] type declaration syntax

Paul Prescod paul@prescod.net
Sat, 18 Dec 1999 14:46:05 -0600


skaller wrote:
> 
> If the inferencer _cannot_ deduce the return type,
> it _also_ cannot check that the function is returning
> the correct type.

Two different issues. Some functions will have return type declarations
that are checked at runtime. I strongly believe that it should be legal
to declare a return type on a function that cannot be proved to return
the type you claim.


def foo() -> String :
	return FunctionThatReturnsStringWhenICallWithString("abc")

def foo() -> Int :
	return FunctionThatReturnsIntWhenICallWithInt(5)

Anyhow, the inferencer won't have access to all of the code. We still
need to deal with pre-compiled functions.

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for himself
Three things see no end: A loop with exit code done wrong
A semaphore untested, and the change that comes along
http://www.geezjan.org/humor/computers/threes.html