[Nickle]Scoping rules for declarations
Jamey Sharp
nickle@keithp.com
31 Jan 2002 00:10:33 -0800
On Wed, 2002-01-30 at 23:32, Keith Packard wrote:
> ... the function type in the definition may be a
> subtype of the original declaration type. This permits
>
> int function foo (int x);
>
> int function foo (real x) { return floor (x); }
>
> This makes sense if you think of this as just an assignment statement
> with different syntax.
Cool, it looks like you made the return type do the right thing too:
> real function baz (int x);
> real function bar () { return baz(37); }
> int function baz (int x) { return x + 5; }
> bar()
42
Except I don't know nickle well enough to check the return type of baz.
Will there be a type promotion in either of these functions? I'm
curious.
--
Jamey Sharp <jamey@sharp.ath.cx> - http://jamey.is.dreaming.org/