On Mon, Aug 01, 2005 at 03:16:50PM +0200, "TSa (Thomas Sandla�)" wrote: > sub equitype ( ::a $x, a $y) { ... }
That's not a bad idea at all. I rather like it. I'd just still like an explicit type-unifying parens around ::a, just so people won't say sub foo (::Int $x) { ... } and accidentally rebind Int. > which is the same behaviour as for the value of $x which can be used > immediately for subsequent parameter bindings. Hmm, how do coderefs behave > in that respect? > > sub codeparam ( &foo, ?$val = foo ) {...} > > Does this invoke a &bar argument once for the call codeparam( &bar ) > and capture the result in $codeparam::val while the call > codeparam( &bar, 42 ) stores 42 without invoking &bar through > &codeparam::foo? Yes. > And in which exact environment does a call to &bar take place when > needed to bind $val? Purely ::CALLER? Signature as bound so far? > ::OUTER of the use'er of the package which contains &codeparam? Or the > ::OUTER of the 'real' package file? The lexical scope of the sub, with the signature bound so far. Thanks, /Autrijus/
pgpM1FYbFZk1F.pgp
Description: PGP signature