On Sat, 2007-03-24 at 16:54 -0700, Erick Tryzelaar wrote:
> Currently if you have a formatting string f"%s", it expects a charp 
> instead of a string. To get the string, you need f"%S". Since I'd expect 
> that felix strings will be used much more often than charps, mind if I 
> swap the two meanings?

The main reason for %s being a charp (char *) is that this is the
C meaning.


> Also, once we roll out the show typeclass, we probably should replace 
> "%s" with a call to Show::str, so that "%s" can be used for most types.

Actually that won't work with the current model I don't think.
The reason is that

        f"%s"

is actually a FUNCTION, not a piece of data:

        f"%s": charp -> string
        f"%d": int -> string

and in particular it's a closure .. Felix doesn't allow
closures over polymorphic functions. (But I'm not sure,
perhaps it will work if the closure is never formed,
as for other polymorphic functions).

It would certainly be nice if %s automatically invoked str()
on its argument.


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

Reply via email to