> 1. Asserted
> 
>     The usual case for Perl 6 functions, due to its default "Item"
>     signature for parameters.  In the example below, I assume that ::* cannot
>     be changed freely to do away with ::*IO at runtime.  (If it could, then
>     assertions won't be of much use in general.)
> 
>         sub f (IO $x) { $x.close }
>         f(open('/etc/passwd'));
> 
>     As both &f and &open may be rebound at runtime, we cannot guarantee that
>     this will not go wrong.  However, we can insert an runtime assertion for 
> $x
>     in &f's scope, so we can avoid doing the same assertion in &*IO::close
>     again.  If IO is declared as final, then &*IO::close can also be resolved
>     statically.

Could this be implemented optimistically, with disabled 
assertions which are enabled at runtime if either &f or &open 
are rebound?

I hope I've understood your point correctly.

Brad

PS. I'm not on p6c

-- 
 To treat a person harshly is the way of middle-classed lackeys.
                                  -- Hagakure http://bereft.net/hagakure/

Reply via email to