From: "trans. (T. Onoma)" Date: 2004-10-27T09:12:04+09:00 Subject: Re: Inline YAML in Ruby code - possible? converse? On Tuesday 26 October 2004 04:54 pm, Peter wrote: | > You can use Peter Vanbroekhoven's patch for user defined %-methods. Find | > it here: | > | > http://developer.berlios.de/projects/suby/ | | I just wanted to add that if you find the courage to patch the Ruby source | and recompile it, be aware that the patch is not backward compatible with | current Ruby; it breaks a number of things, and changes some other things. Hmm.. that sort of makes it sound like it will bring down your whole system :) I don't think its that bad. I've tried it and works rather well. Here are the specific notes below. Is there more to it than these points? If no, then I think it's pretty usable. Just be aware of following potential snags. Notes: Patches the ruby source (v1.8.2, may work for other versions) such that it allows to redefine the %-literals. The literals are enabled when passing -% as option to the Ruby interpreter. This is done to enable Ruby to still compile its extensions, since there are a number of backwards incompatibilities incurred by this patch: * %x becomes %X (%x still works but without escaping) * %r becomes %R (ditto) * The o option for %r is broken. * %W is _terminally_ broken. Try %W{ hello\ world #{} } and see what happens before & after. * 'def %a' no longer means 'def %(a)' * Cannot be called with a receiver Nontheless, it is an expiremental patch. Do not use in production environments! | If you have some patience, I'll brew a version that can retain backward | compatibility at the price of lack of uniformity. I'd prefer the uniformity. I don't think %r and %x, nor def %a, are commonly used enough to fuss about. /%r/%R/ is easy enough any way. T.