[Types-sig] Re: Pascal style declarations
Greg Stein
gstein@lyra.org
Tue, 14 Dec 1999 14:59:49 -0800 (PST)
A bit wordy, but that might work!
On Tue, 14 Dec 1999, Christian Tismer wrote:
> Greg Stein wrote:
>...
> > We already have expr-based (the "assert" statement) -- we can assert types
> > on expressions anywhere. It is just a little less convenient since we must
> > place the expression value into a temporary variable, assert the type of
> > that, then continue with the expression. The "type-assert operator"
> > simplifies this process dramatically.
>
> Why not use "assert" instead of "as" as an operator?
>
> def f(x):
> a = x assert int
> #... stuff
> return str(x) + g(x) assert string # assert binding low precedence
--
Greg Stein, http://www.lyra.org/