Hi,

At Tue, 9 Sep 2003 03:42:53 +0900,
why the lucky stiff wrote:
> > Namely, the idea of an extensible %_{} syntax, so that one could
> > define the behavior of %y{}, %x{}, and so on from within a Ruby
> > program or extension.
> >
> > Perhaps someone steeped in the ways of the parser could comment on
> > how hard this would be (up to and including impossible).
> >
> 
> this wouldn't be much of a problem.  right now there's a 'default' case on a 
> switch in parse.y:
> 
>           default:
>         yyerror("unknown type of %string");
>         return 0;
> 
> establish a USERSTR set of tokens and node types.  (you can follow XSTR or 
> DXSTR around to see how.)  Then, in rb_eval, add a case for NODE_MISCSTR, 
> which could check for the character in a global hash, passing the string 
> contents into a proc associated with that character.  return the result of 
> the proc call from rb_eval.

A few questions.

(1) Can the interpolation take place in such literals?

(2) When should the string be processed, while parsing, after
    parse, or runtime?

(3) If it will be in runtime, is it only once, or each time?

BTW, your patch fails with #{}.  See
<http://nokada.jin.gr.jp/ruby/yaml-literal.diff>.

-- 
Nobu Nakada