From: Navindra Umanee Date: 2005-07-17T11:42:52+09:00 Subject: Re: delaying string evaluation Eric Hodel wrote: > > apply it in the second line in proper order, and if you have any > > independent occurrence of % in the string, I'm not entirely sure how > > to escape it. (Side note: Using %% is enough to escape it) > I find \#{} hard to read because I have to think about it. (It also > feels very funny.) Yeah, that's true. It's doing something special since it's essentially delaying evaluation. It's almost sort of a simplistic lambda, but for strings. If I were to do the same thing in erb, "#{expanded} \#{delayed}" would become: "<%= expanded %> <%%= delayed %>" The double % should give you same pause that \ does. I am somehow loath to mix both syntaxes, although I realise that's an option. I don't really know why I would want to use one syntax to partially build a template and another syntax to build the rest. > See also http://raa.ruby-lang.org/search.rhtml?search=template > > Its so easy to write a proper one that everybody does it! It seems > to be the second Ruby project everyone uses. Hehe! Thanks a lot for the info. I'll have to think about this and play around with a few of them. Cheers, Navin.