dblack / wobblini.net wrote:
> Hi --
> 
> On Tue, 22 May 2007, Brad Phelan wrote:
> 
>> In general I think that above is not a good idea for Ruby. However it 
>> does look good when dealing with libraries like Markaby where the 
>> number of closing ends starts to look very scary From some of my own 
>> templates
>>
>>
>>        table do
>>            @components.each do |row|
>>                tr do
>>                    row.each do |col|
>>                        td do
>>                            pre do
>>                                text col
>>                            end
>>                        end
>>                    end
>>                end
>>            end
>>        end
>>    end
>>
>> whereas it could look like
>>
>>
>>        table do :
>>            @components.each do |row| :
>>                tr do
>>                    row.each do |col| :
>>                        td do :
>>                            pre do :
>>                                text col
>>
>>
>>
>> which gives it a feel like a YAML file.
> 
> I prefer Ruby files that feel like Ruby files (why is everyone so
> concerned with trying to figure what, other than Ruby, Ruby should
> look like?), but meanwhile if you use standard indentation (and get
> rid of the extraneous end in your example :-) it looks a lot nicer to
> start with:

I am not concerned really either way with the indentation thingie. I
don't think that is the main difference between python and Ruby. In my 
op' the fact that Python does not do generic blocks is the main arguing 
point. I am not sure why the indentation issue raises so much heat.

What interests me about this thread is that, if you wish,
you can transparently add your own dialect to ruby by overloading
require. I've done the same thing before to load ERB files as if
they were real ruby files on the path. I jumped in at the challenge
of the OP as to whether transparent preprocessing is possible. The fact 
that it is and so simply is a nice sign of the power of the ruby language.


B