On Sat, 2007-02-10 at 18:58 -0500, Chris King wrote: > is there a format specifier for a string so one can avoid > cstr()?
I have just rehacked the C format hack as follows: * you can now use format specifier S (capital S) for a string argument * you can now specify positions like print$ f"%2$+10.3d --> %S\n" ("Hello",99); The %99$ format is a common extension to C formats, especially useful for i18n applications such as gettext message catalogs (where language grammars dictate different ordering of arguments in messages). The position indicators work even if your C library doesn't support them: they're handled by Felix directly. Positions count from left to right for formats without any specified position, that is, formats WITH a position don't increment the count. The position numbers are ONE origin .. even though Felix numbers tuples ZERO origin (but Felix numbers $1, $2 arguments for primitives ONE origin .. just to confuse you :) * there's a lot more error checking of the formats now * you cannot leave out an argument position * You cannot use position specifiers for * specifiers (this is a buglet) -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language