Defining a parameterized subtype

[email protected] (Guillaume Rousse)
Newsgroups perl.moose
Message-ID <[email protected]>
Hello list.

I'd like to define my own parameterized ClassName subtype, to enforce 
inheritance from a given class. Something more generic than

subtype 'FooClassName'
     => as 'ClassName'
     => where { $_->isa('Foo') };

subtype 'BarClassName'
     => as 'ClassName'
     => where { $_->isa('Bar') };

etc...

I found a 'add_parameterizable_type' method in 
Moose::Util::TypeConstraints, but not much details about to retrieve the 
parameter in the constraint clause.
-- 
Guillaume Rousse
Moyens Informatiques - INRIA Futurs
Tel: 01 69 35 69 62
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.