From: "Dmitry V. Sabanin" Date: 2003-11-11T11:22:21+09:00 Subject: Re: macros 11/11/2003, "T. Onoma" you wrote: >has anyone given any thought to having macros in ruby? > >perhaps there's another way to do what i want, but i'm not sure. i keep reusing the same snippit of code over and over in this one class that includes a few variables, a dumbed-down example: > > "/Path/To/#{variable}/Directory" > snipped >hmmm...guess there's always eval. > >thoughts? Is ("/Path/To/%s/Directory" % [variable]) usable to you? You can store string itself in some place, and then just do (str % [variable]) -- sdmitry -=- Dmitry V. Sabanin MuraveyLabs.