From: Wesley J Landaker Date: 2003-11-20T22:45:39+09:00 Subject: Re: inline_ruby (was: Re: "stereotyping" thread) --Boundary-02=_AWMv/4LtVw5qNzf Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Description: signed data Content-Disposition: inline On Thursday 20 November 2003 12:24 am, Bill Kelly wrote: > From: "Wesley J Landaker" > > > Sometime I'll have to post about my C++ preprocessor that lets you > > embed ruby in C++. Unlike other implementations I've seen, it's > > two-way -- you can put variables in, and get them back out. ;) > > [...] > > > string s =3D "fooxar"; > > printf("My favorite words are %s.\n", > > inline_ruby { %{s}.sub('x','b') + " and " + "bar" }); > > Wow! That's really neat!! I wrote it specifically for use in a project, but I need to clean it up=20 so that I'm not totally embarassed when I post code. ;) heh heh.=20 (Actually, it works well, but I haven't used it in a while.) It really is cool, though. Right now it uses an embedded ruby=20 interpreter. One possible TODO I'd perhaps like to try is to use the=20 same interface, but make the backend communicate with ruby in another=20 process. (It's a long story, but the reason behind that would be to be=20 able to have multiple independant "embedded" ruby interpreters...=20 something that last time I tried to do I gave up fairly quickly after=20 seeing all the global variables!) > > Ah, I need to package that up for release, it's lots of fun. =3D) > > I'm definitely eager to try it out ! I'd actually almost forgotten about it. I'll dig it back up, clean it=20 up, and post more info here in a few days. (Err, unless I don't get to=20 it before I go out of town for the thanksgiving holidy here in the=20 US...) Okay, so, a few weeks. ;) I'll probably throw it on a subversion=20 server here at icecavern, but I'll put the project page on rubyforge. =2D-=20 Wesley J. Landaker - wjl@icecavern.net OpenPGP FP: 4135 2A3B 4726 ACC5 9094 0097 F0A9 8A4C 4CD6 E3D2 --Boundary-02=_AWMv/4LtVw5qNzf Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQA/vMWA8KmKTEzW49IRAsUrAJ9Ytm5TQj+aBy8ikHbo8aBWOV3dngCcD/Ip YyvRb/xUcYVC3dP+CI2SWkE= =OG6n -----END PGP SIGNATURE----- --Boundary-02=_AWMv/4LtVw5qNzf--