[Types-sig] Re: [Types Sig] Progress

Greg Stein gstein@lyra.org
Fri, 17 Dec 1999 20:44:53 -0800 (PST)


On Sat, 18 Dec 1999, skaller wrote:
>...
> >>>>>>>>>>>
> 3. We agree that we need a syntax for asserting the types of expressions
> at runtime. Greg proposes ! but says he is flexible on the issue. The
> original RFC spelled this as:  has_type( foo, types.StringType ) which
> returns (in this case) a string or NULL. This strikes me as more
> flexible than ! because you can use it in an assertion but you don't
> have to. 
> <<<<<<<<<<<
> 
> I don't think we agree on this: Guido says that assertions
> are good enough. I wouldn't argue.

The '!' operator is much more than just a new name for "assert". It can
assist the compiler in determining the type of an expression value, which
leads to the ability to type check and/or optimize.

In other words, I believe Guido is wrong (heresy!) -- assertions are not
good enough.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/