skaller wrote: > 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.
Oh I know, but since I expect felix strings would be used more often than charps, swapping the meaning might make a little more sense to someone new to the language. I realize that this is all just getting passed to vsnprintf, but we could change the string on our side to make it how we like it. >> 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). I assume that includes functions using typeclasses to restrict the polymorphism? ------------------------------------------------------------------------- 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