Damian Conway <[EMAIL PROTECTED]> writes: > Piers Cawley wrote: > >>> C<is> is compile-time. >> So, how would one create a class which inherits from some other >> class >> when you don't know what said other class is until runtime? > > Use Perl5-ish classes, or an C<eval>.
Perl5-ish classes? You mean 'bless {}, Foo' is still going to work? Frankly, I find that scary. And eval is such a hackish way of doing this kind of malarkey. >> Does this work: >> class { push @ISA, $class; >> ... >> } > > I sincerely hope not! Okay, assuming that a class definition is actually an instance of the Class class, please tell me I can do: Class.new( isa => $class ) { method { ... } method { ... } }.new Hmm... a constructor with an optional block... that looks scary, but good scary. -- Piers "It is a truth universally acknowledged that a language in possession of a rich syntax must be in need of a rewrite." -- Jane Austen?