Re: eruby delimiters

Christian Luginbuehl <[email protected]> Fri, 09 Jul 2004 12:16:04 +0200
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
hi shugo,

> I rejected same proposals before, but I changed my opinion. Because many
> people proposed it.
> 
> But I think the default behaviour should not be changed.
> So `<?ruby' will be enabled by an option of configure.rb or a command
> line option.
> 
>   $ ./configure.rb --enable-xml
> 
> or
> 
>   $ eruby --xml bar.txt
> 
> (The name `xml' may not be appropriate.)

i would be happy with both ideas. the second proposal seems to be of 
better use in the field, if you are able to switch depending on the 
input file.

but still i think the code for the two delimiter-combinations should be 
the same for both ideas. means: the same piece of code should also for 
the compile-time option should work for the long <?ruby as well as for 
the short <%. am i clear?

>> - i did not quite understand the part that does transform <%% to <% (and
>>   simply removed it). why should this be done? is the % at the beginning
>>   of a line of any use (this oen i didn't touch)?
> 
> 
> `<%%' is used to escape `<%'.
> This enables you to describe the syntax of eRuby in eRuby files.
> 
 > [ SNIP examples ]
> 
> How do you think about the escape sequence for `<?ruby'?

thanks for the explanation. i could imagine the analogous escape 
sequence for <?ruby, namely <?ruby%. but still i did not think alot 
about that issue because even the idea of escaping ruby-code like that 
was new to me. at the moment i don't even see the use of that clearly.

> Then, % at BOL is used to avoid extra newlines.
> 
> [ SNIP examples ]
 >
> You can eliminate these extra newlines by % at BOL.
> 
> [ SNIP examples ]

i always liked the problem of extra newlines coming from nowhere in 
other languages like JSP, PHP, XSL and not really be able to do a lot 
against them ;-)


dinkel