-- Sent from my phone
On Nov 17, 2010 11:48 AM, "Daniel Barlow" <daniel....@gmail.com> wrote:
>
> I think I need to call
> java.lang.Class.getDeclaredMethod(String,Class[]) from Mirah, but I
> can't figure out the syntax for the second argument.
classes = Class[1]
classes[0] = String.class
>
> The assumptions that led me to this point:
> 1) that o.send is purposely not implemented so I need to use the Java
> reflection support instead
Well there's no on purpose there. This probably isn't something we'd add to mirah itself but it should be easy to add this as an extension. Also if you're using Java 1.7 you can use dynamic types in mirah. I think there's a sample in the examples directory.
> 2) that mirah is close enough to ruby that I stand a reasonable chance
> of implementing a DSL to generate Android Layouts and replace the
> rather ugly verbose XML stuff in regular android apps. I don't need
> instance_eval, but I'm assuming block.yield will work more or less as
> it does in ruby
Well you can't use yield, but you can achieve the same things using an interface or a macro. I think there should be an example of using an interface on the mirah.org wiki or this mailing list, but I won't be able to look it up until I finish traveling and get back to a computer.