Calling a method by name.

Robert Fraser fraserofthenight at gmail.com
Wed Jun 27 00:57:56 PDT 2007


http://flectioned.kuehne.cn/

Check there for info about D's runtime reflection capabilities. I'm not _sure_ if flectioned supports it or not, but I think so.

Lurker #5 Wrote:

> One more thing... How can I call a method by name? I was looking at the ClassInfo but I cant' find a way to call a method like this:
> 
> class Commands
> {
>   void command1() {}
>   void command2() {}
>   void command3() {}
> }
> 
> Commands cmds = new Commands();
> char[] cmd = readLine();
> call(cmd, cmd);
> 
> Any ideas on how to implement this call() method?
> 
> Tnks



More information about the Digitalmars-d-learn mailing list