develooper Front page | perl.perl6.language | Postings from June 2001

Re: Properties and stricture

Thread Previous | Thread Next
From:
Damien Neil
Date:
June 5, 2001 16:12
Subject:
Re: Properties and stricture
Message ID:
20010605161240.B14176@misago.org
On Tue, Jun 05, 2001 at 11:14:29PM +0100, Michael G Schwern wrote:
> my $meth = "foo";
> $obj->$meth();  # $obj->foo();
> 
> I'm probably using the wrong terms.
> 
> This definately can't work if $obj is of a class which is strongly
> typed.        

You would do that in Java by using reflection.  There's nothing about
strong typing which prevents dynamic method calls like this, although
you obviously can only verify the sanity of the call at runtime.

                           - Damien

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About