On Sun, 2007-02-11 at 10:00 -0800, James Dennett wrote:
> skaller wrote:
> > [...]
> > * 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).
> >
> >
> >   
> [...]
> > * you cannot leave out an argument position
> >   
> Could you give an example of what you mean by that?

Sure: you cannot write:

print$ f"%2$d" (1,2);

because there is no specifier for argument 1.
You can't do this either:

print$ f"%1$d %1$f" (??);

for the same reason: each argument position must have
a uniquely determined type. Leaving out an argument
would make the type indeterminate .. which would be
fine if format specifiers could be polymorphic
(but at the moment they can't be).

The second case has conflict types: int and double.
You CAN have different specifiers though:

print$ f"%1$7.3f %1$7g" 1.2;

provided they apply to the same type.

-- 
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

Reply via email to