From: Tom Sawyer Date: 2002-08-28T23:41:27+09:00 Subject: Re: Replacement for eval? On Wed, 2002-08-28 at 08:24, Tobias Huesgen wrote: > Hi! > > First of all: I'm a German pupil who is just learning ruby and English > :) > > I have a xml-file in which most elements are standing for > function-/method-calls. I "convert" each element in a > Ruby-method-call(string) and add this method-call to one string. > Because I need to call these methods several times I used eval until now > to parse this string. > But someone from the German mailinglist told me that eval is slowly and > that programming with eval isn't that good. > I think do parse the xml-file again and again must be very slow, or I'm > wrong? > So: what can I use instead of eval? Tobias, i did a similar thing creating xml:Tails (a Tag Attribute Language for Ruby and XML like Zope's) i did not bother to keep working on it because it was way too slow. the best thing to do, if you don't have to do full out evaluation of blocks of Ruby code, is to use #send. ~transami