--- Damian Conway <[EMAIL PROTECTED]> wrote:
> Austin Hastings wrote:
> 
> > You're treading dangerously close to the S&M line there... 
> 
> Sure. That's exactly what types are for.
> 

Granted.

> > Does it make sense to say C<use strict params;> for this stuff?
> 
> I'd much rather that simply using typed params invoked type
> stricture.

Sure, but there's a difference between "C" (Boy Scout Oath) strictness
and "C++" (FBI will visit your home and do a thorough background check
before we proceed) strictness.

In this case, I rather like the idea of being able to say

   sub foo(@a is Array of Int) {...}

   my @input = read_a_bunch_o_data();
   foo(@input);


Where the compiler will automatically "wrap" the @input array in a
make-it-an-int converter. This, to me, is DWIM.

Connecting this with some thinking/talking about wrappage, it occurs to
me that:

C<call> is just a keyword. Which means that instead of doing 

foo.wrap({ ...; call; ... });

I could just as easily do:

sub wrapper(...) { ...; call ; ... }
foo.wrap(&wrapper);

Right?

I think there may be a library of wrapper "helper-functions" used by
both the compiler and module-writers. Things that do coercive behavior
rather than try-but-maybe-fail behavior.

So the "use strict signatures;" wouldn't be a switch invoking type
stricture, per se. What it would do is convert from "DWIM stricture" to
"Patriot Act stricture".

=Austin

Reply via email to