Re: RFC 128 (v1) Subroutines: Extend subroutine contexts to includename parameters and lazy arguments
[email protected] ("David L. Nicol") Tue, 22 Aug 2000 22:25:17 +0000
| Newsgroups | perl.perl6.language.subs |
|---|---|
| Organization | University of Missouri - Kansas City supercomputing infrastructure |
| Message-ID | <[email protected]> |
> > > Is there any mileage in extending the syntax to allow the contents > > of an array or hash to be checked. In general I find quite often > > that I am checking to make sure that an array has at least N > > elements (ignoring issues with sparseness) and that a hash has a > > specific set of keys in it (see eg my PDL::Options module which > > translates user supplied keys [generally typed at a command line] > > into a set of keys the subroutine actually required [correcting for > > case and minimum matching]). It seems only a small jump to go from > > this RFC to a version that will peek inside the arguments [but it > > might be a can of worms]. > > A can of *vipers*, I think! We could push the envelope a *lot* further > out than just peering inside arguments: regexes as type names, > inter-parameteric context constraints, predicate dispatching. > There's such a thing as being *too* powerful. if we allow required _types_ then those types can insure their validity (or sane default values)