HI there,

I'm trying to improve the performance of an application we're working
on which makes a fair bit of use of the eval statement. We're tryignt
o weed out the use of eval due to the performacne overhead and there
is one section of code we haven't as yet been able to improve upon.
Any help very much appreciated.

Here is a sample code snipped. The key points which 'cannot' be
changed is that the classname must be sourced from a variable and not
static (same for the parameters).

                var widgetName = "Button";
                var widgetParam1 = "I am parameter 1";
                var widgetParam2 = new Array("I am ", "parameter 2");
                eval("var myWidget = new "+widgetName+"(widgetParam1,
widgetParam2);");

Many thanks
Gareth
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to