On Wed, 2007-03-21 at 23:30 -0700, Erick Tryzelaar wrote: > >>> t = Template("<h1>Hello {{ first_name }}, {{ last_name }}</h1>") > >>> print t.render({"first_name": "Erick", "last_name": "Tryzelaar"}) > <h1>Hello Erick Tryzelaar</h1> > >>> print t.render({"first_name": "John", "last_name": "Skaller"}) > <h1>Hello John Skaller</h1> > > How could we do this simply in felix,
Do you mean like this? ///////////////////////////////////////// #import <flx.flxh> val name = "Erick"; print$ q"Hello $name\n"; ///////////////////////////////////////// [EMAIL PROTECTED]:/work/felix/svn/felix/felix/trunk$ f nam Hello Erick The $ interpolation allows an arbitrary expression if you use brackets like $(expr) so there's no problem with dictionary substitutions via STL map or whatever. I would have liked to merge f".." and q".." strings into the one kind, but at the moment they're separate features. -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language