On Mon, Oct 3, 2011 at 11:19 AM, Yusuke Endoh <mame / tsg.ne.jp> wrote:
> Hello,
>
> 2011/10/4 Trans <transfire / gmail.com>:
>> Yes, in fact #margin was born from the idea of %L. The downside of
>> #margin is that it requires more processing overhead, where as the
>> literal notation would be very fast (if it is possible to implement in
>> Ruby parser).
>
> Actually, I prefer %L, but didn't succeed to implement it.
> It is difficult to determine the end of %L.
> My patch requires an empty line at the end.
> Though, nobu may be able to overcome the difficulty?

Color me impressed. I wish I could fully comprehend such code. But
then again that's why I use Ruby and not C --so I don't have to :-)

Determining the end is the difficulty which I assume matz was making
reference. Other then a blank line, it can only go by the fact the
next line doesn't start with the marker (and maybe properly indented).
That in itself may be problematic if the parser can't process a line
that both closes the last statement and starts a new one.

Some people object to the idea of a margin indicator as too ugly in
its own right. I don't share that sentiment, but I don't dismiss their
sensibilities out-of-hand either. If the ambiguity of determining the
end of the statement is too much a problem, then the other solution
would be:

  p %L!foo
      bar
      b#{ ?a }z!0

Where the starting margin indicator (`!`) indicates an indention point
that one "imagines" traveling down through each line. An optional
number could be appended flush to the end marker to indicate extra
whitespace padding, akin to %r{}img.