The simple answer is no. From a good programming practice/memory standpoint the answer is almost always yes, especially if this is code that will be called frequently in your application. Having 1000 identical strings vs 1 symbol.
On Fri, Apr 10, 2009 at 8:36 AM, westhielke <[email protected]> wrote: > > Hi, > > In the week3 lab, the exercise RubyMeta_DefineMethod2 uses > > define_method $my_method.intern do |arg1, arg2| ........... > > I looked up the "intern" method and it says that it creates a symbol > from the string, if it does not already exist. However, I tried > running this without calling the intern method and I didn't see any > differences. > > So, my question is whether the intern method is actually required in a > case like this where a string object is being passed as the method > name parameter to define_method. > > Wes > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ruby-on-rails-programming-with-passion" group. To unsubscribe from this group, send email to ruby-on-rails-programming-with-passion-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en -~----------~----~----~----~------~----~------~--~---
